Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
d910a7c2
提交
d910a7c2
authored
11月 20, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(views/promotion/table): 样式:修改店内执行上报复用表格的样式
上级
11d86ae8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
131 行增加
和
190 行删除
+131
-190
index.vue
src/views/promotion/components/Table/index.vue
+79
-164
display.vue
src/views/promotion/display_schedule/tabs/display.vue
+44
-18
schedule.vue
src/views/promotion/display_schedule/tabs/schedule.vue
+0
-0
schedule_dis.vue
src/views/promotion/display_schedule/tabs/schedule_dis.vue
+4
-4
snack.vue
src/views/promotion/display_schedule/tabs/snack.vue
+4
-4
没有找到文件。
src/views/promotion/components/
CommonPlan
/index.vue
→
src/views/promotion/components/
Table
/index.vue
浏览文件 @
d910a7c2
<
template
>
<
template
>
<!-- 操作类型 -->
<el-row>
<el-row>
<el-form-item>
<el-form-item>
<el-radio-group
v-model=
"operation"
<el-radio-group
v-model=
"operation"
...
@@ -6,7 +7,8 @@
...
@@ -6,7 +7,8 @@
<el-radio-button
label=
"展示模式"
<el-radio-button
label=
"展示模式"
value=
"展示模式"
/>
value=
"展示模式"
/>
<el-radio-button
label=
"填报模式"
<el-radio-button
label=
"填报模式"
value=
"填报模式"
v-if=
"useFill"
/>
value=
"填报模式"
v-if=
"showFill"
/>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<right-toolbar
v-model:showSearch=
"showSearch"
<right-toolbar
v-model:showSearch=
"showSearch"
...
@@ -16,11 +18,11 @@
...
@@ -16,11 +18,11 @@
:defaultCheckedKeys=
"visibleProps"
>
:defaultCheckedKeys=
"visibleProps"
>
</right-toolbar>
</right-toolbar>
</el-row>
</el-row>
<!--
筛选列组的按钮
-->
<!--
数据表格
-->
<el-table
:data=
"tableData"
<el-table
:data=
"tableData"
border
border
ref=
"tableRef"
ref=
"tableRef"
class=
"auto-fit-header-table
"
class=
"auto-fit-header-table"
:class=
"
{ 'cell-no-padding': operation === '填报模式' }"
:class=
"
{ 'cell-no-padding': operation === '填报模式' }"
v-loading="isLoading">
v-loading="isLoading">
<template
v-for=
"col in tableColumns"
>
<template
v-for=
"col in tableColumns"
>
...
@@ -47,21 +49,19 @@
...
@@ -47,21 +49,19 @@
<!-- 填报模式 -->
<!-- 填报模式 -->
<div
v-if=
"operation === '填报模式'"
<div
v-if=
"operation === '填报模式'"
style=
"overflow: visible !important;"
>
style=
"overflow: visible !important;"
>
<!--
带选择框/输入框的操作
单元格 -->
<!--
自定义渲染内容
单元格 -->
<div
v-if=
"col.render"
<div
v-if=
"col.render"
class=
"cell-style"
>
class=
"cell-style"
>
<component
:is=
"col.render(h, row, col)"
/>
<component
:is=
"col.render(h, row, col)"
/>
</div>
</div>
<!--
正常显示/
公式计算 -->
<!-- 公式计算 -->
<div
v-else-if=
"col.type === 'formula'"
>
<div
v-else-if=
"col.type === 'formula'"
>
{{
col
.
func
(
row
)
}}
{{
col
.
func
(
row
)
}}
</div>
</div>
<div
v-else
<!-- 其他类型内容 -->
class=
"overflow_wrap"
>
<div
v-else
>
<!-- 超出部分显示省略号 -->
<!-- 正常显示 -->
<span>
<span>
{{
row
[
col
.
prop
]
||
'-'
}}
</span>
{{
row
[
col
.
prop
]
||
'-'
}}
</span>
</div>
</div>
</div>
</div>
<!-- 展示模式 -->
<!-- 展示模式 -->
...
@@ -79,21 +79,16 @@
...
@@ -79,21 +79,16 @@
<
script
setup
>
<
script
setup
>
import
{
h
}
from
'vue'
import
{
h
}
from
'vue'
/*************** 操作类型 ***************/
const
operation
=
ref
(
'展示模式'
);
// const operation = ref('填报模式');
const
tableRef
=
ref
(
null
)
const
props
=
defineProps
({
const
props
=
defineProps
({
tableColumns
:
{
// 表格列
tableColumns
:
{
// 表格列
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
},
chooseColumns
:
{
//
右上角工具选择列
chooseColumns
:
{
//
显隐列数据结构
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
},
visibleProps
:
{
//
右上角工具为树结构
,默认勾选的列
visibleProps
:
{
//
显隐列数据
,默认勾选的列
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
},
...
@@ -101,38 +96,36 @@ const props = defineProps({
...
@@ -101,38 +96,36 @@ const props = defineProps({
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
},
isLoading
:
{
isLoading
:
{
// 表格加载状态
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
total
:
{
total
:
{
// 总条数
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
},
},
params
:
{
params
:
{
// 分页参数
type
:
Object
,
type
:
Object
,
default
:
()
=>
({
default
:
()
=>
({
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
})
})
},
},
// 启用填报模式
showFill
:
{
// 是否显示填报模式
useFill
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
// 格式化表格某列内容
formatter
:
{
// 格式化函数
formatter
:
{
type
:
Function
,
type
:
Function
,
default
:
(
row
,
col
,
cellValue
)
=>
cellValue
default
:
(
row
,
col
,
cellValue
)
=>
cellValue
}
}
})
})
const
emit
=
defineEmits
([
'updateColumns'
,
'getTableList'
,
'updateShowSearch'
])
const
emit
=
defineEmits
([
'updateColumns'
,
'getTableList'
,
'updateShowSearch'
])
// 右上角工具
/*************** 工具栏 ***************/
const
showSearch
=
ref
(
true
)
// 切换平铺/填报模式
// 切换平铺/填报模式
const
operation
=
ref
(
'展示模式'
);
const
tableRef
=
ref
(
null
)
const
checkTableColumns
=
async
()
=>
{
const
checkTableColumns
=
async
()
=>
{
// 通知外面传入 tableColumns / chooseColumns 数据源
// 通知外面传入 tableColumns / chooseColumns 数据源
await
emit
(
'updateColumns'
,
operation
.
value
)
await
emit
(
'updateColumns'
,
operation
.
value
)
...
@@ -144,177 +137,98 @@ const checkTableColumns = async () => {
...
@@ -144,177 +137,98 @@ const checkTableColumns = async () => {
}
}
})
})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
checkTableColumns
()
checkTableColumns
()
})
})
const
getTableList
=
()
=>
{
// 控制搜索框显隐
emit
(
'getTableList'
)
const
showSearch
=
ref
(
true
)
}
watch
(
showSearch
,
(
newVal
)
=>
{
watch
(
showSearch
,
(
newVal
)
=>
{
emit
(
'updateShowSearch'
,
newVal
)
emit
(
'updateShowSearch'
,
newVal
)
})
})
// 刷新数据
const
getTableList
=
()
=>
{
emit
(
'getTableList'
)
}
</
script
>
</
script
>
<
style
scoped
<
style
scoped
lang=
"scss"
>
lang=
"scss"
>
.container
{
.el-tabs
{
/* 表格样式 */
height
:
100%
;
.auto-fit-header-table
{
display
:
flex
;
height
:
100%
;
flex-direction
:
column-reverse
;
.el-tabs__content
{
/* 列样式 */
display
:
flex
;
.column-style
{
flex-direction
:
column
;
height
:
100%
;
.el-tab-pane
{
/* 列头样式 */
height
:
100%
;
.formula-column
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
.pagination-container
{
.el-icon
{
margin
:
10px
;
margin-left
:
2px
;
}
}
}
}
.formula-column
{
/* 单元格样式 */
display
:
flex
;
/* 自定义渲染内容 */
justify-content
:
center
;
.cell-style
{
align-items
:
center
;
margin
:
0
-12px
;
.el-icon
{
>
div
{
margin-left
:
2px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
>
span
{
text-align
:
left
;
text-indent
:
5px
;
display
:
inline-block
;
width
:
100%
;
background-color
:
#e1e2e6
;
border-bottom
:
1px
solid
#ebeef5
;
}
}
}
}
}
}
.el-form-item
{
align-items
:
center
;
}
/* 表格区域 */
/* 表格内下拉框 */
.auto-fit-header-table
{
.el-select
{
width
:
100%
!
important
;
padding
:
10px
;
}
/* 优化超长文本的显示效果 */
.el-input
{
.cell
{
padding
:
10px
;
}
/* padding: 0 .2133rem; */
.date-picker
{
>
div
{
width
:
100%
;
width
:
100%
;
overflow
:
hidden
;
padding
:
10px
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
&
.cell-no-padding
{
.el-input
{
::v-deep
(
.el-table__row
)
{
width
:
100%
;
.el-table__cell
{
padding
:
0
;
padding
:
0
;
}
}
}
}
}
}
}
::v-deep
(
.column-style
)
{
/* 填报模式-单元格 */
&
.cell-no-padding
{
.cell
{
/* overflow: visible; */
>
div
{
/* overflow: visible !important; */
}
.cell-style
{
margin
:
0
-12px
;
>
div
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
>
span
{
text-align
:
left
;
text-indent
:
5px
;
display
:
inline-block
;
width
:
100%
;
background-color
:
#e1e2e6
;
border-bottom
:
1px
solid
#ebeef5
;
}
}
/* 表格内下拉框 */
.el-select
{
width
:
100%
!
important
;
padding
:
10px
;
}
.el-input
{
padding
:
10px
;
}
.date-picker
{
width
:
100%
;
padding
:
10px
;
.el-input
{
width
:
100%
;
padding
:
0
;
}
}
}
/* 无上下内边距 */
::v-deep
(
.el-table__row
)
{
.el-table__cell
{
padding
:
0
;
}
}
}
}
}
}
/* 特殊动态渲染单元格样式 */
.render-cell
{
p
{
margin
:
0
;
}
}
/* 操作提示列 */
.operation_tip_cell
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
p
{
width
:
100%
;
margin
:
0
;
}
p
:first-child
{
background-color
:
#e1e2e6
;
border-bottom
:
1px
solid
#ebeef5
;
}
p
:last-child
{
padding
:
15px
0
;
}
}
}
}
/* 超出部分显示省略号 */
/* 分页器 */
.overflow_wrap
{
.pagination-container
{
width
:
100%
;
margin
:
10px
;
/* 固定宽度 */
white-space
:
nowrap
;
/* 不换行 */
overflow
:
hidden
;
/* 隐藏超出部分 */
text-overflow
:
ellipsis
;
/* 显示省略号 */
display
:
inline-block
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/promotion/display_schedule/tabs/display.vue
浏览文件 @
d910a7c2
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
<!-- 常规陈列 -->
<!-- 常规陈列 -->
<SearchList
:showSearch=
"showSearch"
<SearchList
:showSearch=
"showSearch"
@
change=
"searchChange"
/>
@
change=
"searchChange"
/>
<C
ommonPlan
:tableData=
"tableData"
<C
ustomTable
:tableData=
"tableData"
:isLoading=
"isLoading"
:isLoading=
"isLoading"
:total=
"total"
:total=
"total"
:tableColumns=
"tableColumns"
:tableColumns=
"tableColumns"
:chooseColumns=
"chooseColumns"
:chooseColumns=
"chooseColumns"
:visibleProps=
"visibleProps"
:visibleProps=
"visibleProps"
:params=
"params"
:params=
"params"
:
useFill=
"use
Fill"
:
showFill=
"show
Fill"
@
updateColumns=
"updateColumns"
@
updateColumns=
"updateColumns"
@
getTableList=
"getTableList"
@
getTableList=
"getTableList"
@
updateShowSearch=
"updateShowSearch"
/>
@
updateShowSearch=
"updateShowSearch"
/>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<
script
setup
<
script
setup
lang=
"jsx"
>
lang=
"jsx"
>
import
C
ommonPlan
from
'@/views/promotion/components/CommonPlan
'
import
C
ustomTable
from
'@/views/promotion/components/Table
'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
{
getDisplayList
,
submitDisplayPlan
}
from
'@/api'
import
{
getDisplayList
,
submitDisplayPlan
}
from
'@/api'
import
{
parseTime
}
from
'@/utils'
import
{
parseTime
}
from
'@/utils'
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
import
userStore
from
'@/store/modules/user'
import
userStore
from
'@/store/modules/user'
// 是否启用填报模式
// 是否启用填报模式
const
use
Fill
=
userStore
().
hasQcMarketEmpInfo
const
show
Fill
=
userStore
().
hasQcMarketEmpInfo
/*************** 操作类型 ***************/
/*************** 操作类型 ***************/
...
@@ -153,7 +153,7 @@
...
@@ -153,7 +153,7 @@
},
},
{
{
label
:
"门店名称"
,
label
:
"门店名称"
,
prop
:
"storeNameCodeDealerName"
,
//
d
新增动态列(只在填报列显示)
prop
:
"storeNameCodeDealerName"
,
//新增动态列(只在填报列显示)
visible
:
true
,
visible
:
true
,
type
:
'string'
,
type
:
'string'
,
fill
:
true
,
fill
:
true
,
...
@@ -163,22 +163,11 @@
...
@@ -163,22 +163,11 @@
width
:
225
,
width
:
225
,
render
:
(
h
,
row
)
=>
{
render
:
(
h
,
row
)
=>
{
return
h
(
'div'
,
{
return
h
(
'div'
,
{
class
:
'render-cell'
,
class
:
'store-name-render-cell'
style
:
{
alignItems
:
'center'
,
whiteSpace
:
'pre-line'
}
},
[
},
[
h
(
'p'
,
row
.
storeName
),
h
(
'p'
,
row
.
storeName
),
h
(
'p'
,
row
.
storeCode
),
h
(
'p'
,
row
.
storeCode
),
h
(
'p'
,
{
h
(
'p'
,
row
.
dealerName
)
style
:
{
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
maxWidth
:
'100%'
}
},
row
.
dealerName
)
])
])
}
}
},
},
...
@@ -1133,4 +1122,40 @@
...
@@ -1133,4 +1122,40 @@
}
}
}
}
</
style
>
<
style
lang=
"scss"
>
// 动态列内容的 render 内样式
// 操作提示列
.operation_tip_cell
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
p
{
width
:
100%
;
margin
:
0
;
}
p
:first-child
{
background-color
:
#e1e2e6
;
border-bottom
:
1px
solid
#ebeef5
;
}
p
:last-child
{
padding
:
15px
0
;
}
}
// 只在填报模式出现的门店名称+门店编码+经销山名称(合并到一起)
.store-name-render-cell
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
p
{
width
:
100%
;
margin
:
0
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/promotion/display_schedule/tabs/schedule.vue
浏览文件 @
d910a7c2
差异被折叠。
点击展开。
src/views/promotion/display_schedule/tabs/schedule_dis.vue
浏览文件 @
d910a7c2
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
<!-- 档期陈列 -->
<!-- 档期陈列 -->
<SearchList
:showSearch=
"showSearch"
<SearchList
:showSearch=
"showSearch"
@
change=
"searchChange"
/>
@
change=
"searchChange"
/>
<C
ommonPlan
:tableData=
"tableData"
<C
ustomTable
:tableData=
"tableData"
:isLoading=
"isLoading"
:isLoading=
"isLoading"
:total=
"total"
:total=
"total"
:tableColumns=
"tableColumns"
:tableColumns=
"tableColumns"
:chooseColumns=
"chooseColumns"
:chooseColumns=
"chooseColumns"
:visibleProps=
"visibleProps"
:visibleProps=
"visibleProps"
:params=
"params"
:params=
"params"
:
useFill=
"use
Fill"
:
showFill=
"show
Fill"
@
updateColumns=
"updateColumns"
@
updateColumns=
"updateColumns"
@
getTableList=
"getTableList"
@
getTableList=
"getTableList"
@
updateShowSearch=
"updateShowSearch"
/>
@
updateShowSearch=
"updateShowSearch"
/>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<
script
setup
<
script
setup
lang=
"jsx"
>
lang=
"jsx"
>
import
C
ommonPlan
from
'@/views/promotion/components/CommonPlan
'
import
C
ustomTable
from
'@/views/promotion/components/Table
'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
{
getDisplayScheduleDetail
,
submitDisplayScheduleDetail
}
from
'@/api'
import
{
getDisplayScheduleDetail
,
submitDisplayScheduleDetail
}
from
'@/api'
import
{
parseTime
}
from
'@/utils'
import
{
parseTime
}
from
'@/utils'
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
import
userStore
from
'@/store/modules/user'
import
userStore
from
'@/store/modules/user'
// 是否启用填报模式
// 是否启用填报模式
const
use
Fill
=
userStore
().
hasQcMarketEmpInfo
const
show
Fill
=
userStore
().
hasQcMarketEmpInfo
/*************** 操作类型 ***************/
/*************** 操作类型 ***************/
// 全部列
// 全部列
...
...
src/views/promotion/display_schedule/tabs/snack.vue
浏览文件 @
d910a7c2
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
<!-- 零食陈列 -->
<!-- 零食陈列 -->
<SearchList
:showSearch=
"showSearch"
<SearchList
:showSearch=
"showSearch"
@
change=
"searchChange"
/>
@
change=
"searchChange"
/>
<C
ommonPlan
:tableData=
"tableData"
<C
ustomTable
:tableData=
"tableData"
:isLoading=
"isLoading"
:isLoading=
"isLoading"
:total=
"total"
:total=
"total"
:tableColumns=
"tableColumns"
:tableColumns=
"tableColumns"
:chooseColumns=
"chooseColumns"
:chooseColumns=
"chooseColumns"
:visibleProps=
"visibleProps"
:visibleProps=
"visibleProps"
:params=
"params"
:params=
"params"
:
useFill=
"use
Fill"
:
showFill=
"show
Fill"
@
updateColumns=
"updateColumns"
@
updateColumns=
"updateColumns"
@
getTableList=
"getTableList"
@
getTableList=
"getTableList"
@
updateShowSearch=
"updateShowSearch"
/>
@
updateShowSearch=
"updateShowSearch"
/>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<
script
setup
<
script
setup
lang=
"jsx"
>
lang=
"jsx"
>
import
C
ommonPlan
from
'@/views/promotion/components/CommonPlan
'
import
C
ustomTable
from
'@/views/promotion/components/Table
'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
SearchList
from
'@/views/promotion/components/SearchList'
import
{
getSnackPlanList
,
submitSnackPlan
}
from
'@/api'
import
{
getSnackPlanList
,
submitSnackPlan
}
from
'@/api'
import
{
parseTime
}
from
'@/utils'
import
{
parseTime
}
from
'@/utils'
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
import
userStore
from
'@/store/modules/user'
import
userStore
from
'@/store/modules/user'
// 是否启用填报模式
// 是否启用填报模式
const
use
Fill
=
userStore
().
hasQcMarketEmpInfo
const
show
Fill
=
userStore
().
hasQcMarketEmpInfo
/*************** 操作类型 ***************/
/*************** 操作类型 ***************/
// 全部列
// 全部列
const
baseColumns
=
ref
([
const
baseColumns
=
ref
([
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论