Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
total-platform
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
物业总平台
total-platform
Commits
dc1059e9
提交
dc1059e9
authored
11月 03, 2022
作者:
zhangdaiscott
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【JVxeTable】修复动态更改columns不生效的问题(变量名不能以下划线开头)
上级
0dbe3f6f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
29 行增加
和
29 行删除
+29
-29
JVxeTable.js
src/components/jeecg/JVxeTable/components/JVxeTable.js
+29
-29
没有找到文件。
src/components/jeecg/JVxeTable/components/JVxeTable.js
浏览文件 @
dc1059e9
...
...
@@ -107,9 +107,9 @@ export default {
// caseId,表格唯一标识
caseId
:
`_j-vxe-
${
randomString
(
8
)}
_`
,
// 内置columns
_
innerColumns
:
[],
innerColumns
:
[],
// 内置 EditRules
_
innerEditRules
:
[],
innerEditRules
:
[],
// 记录滚动条位置
scroll
:
{
top
:
0
,
left
:
0
},
// 当前是否正在滚动
...
...
@@ -156,14 +156,14 @@ export default {
excludeCode
:[],
// 联动下拉选项(用于隔离不同的下拉选项)
// 内部联动配置,map
_
innerLinkageConfig
:
null
,
innerLinkageConfig
:
null
,
}
},
computed
:
{
// vxe 最终 columns
vxeColumns
()
{
this
.
_
innerColumns
.
forEach
(
column
=>
{
this
.
innerColumns
.
forEach
(
column
=>
{
let
renderOptions
=
{
caseId
:
this
.
caseId
,
bordered
:
this
.
bordered
,
...
...
@@ -184,11 +184,11 @@ export default {
}
}
// 处理联动列,联动列只能作用于 select 组件
if
(
column
.
$type
===
JVXETypes
.
select
&&
this
.
_
innerLinkageConfig
!=
null
)
{
if
(
column
.
$type
===
JVXETypes
.
select
&&
this
.
innerLinkageConfig
!=
null
)
{
// 判断当前列是否是联动列
if
(
this
.
_
innerLinkageConfig
.
has
(
column
.
key
))
{
if
(
this
.
innerLinkageConfig
.
has
(
column
.
key
))
{
renderOptions
.
linkage
=
{
config
:
this
.
_
innerLinkageConfig
.
get
(
column
.
key
),
config
:
this
.
innerLinkageConfig
.
get
(
column
.
key
),
getLinkageOptionsSibling
:
this
.
getLinkageOptionsSibling
,
getLinkageOptionsAsync
:
this
.
getLinkageOptionsAsync
,
linkageSelectChange
:
this
.
linkageSelectChange
,
...
...
@@ -224,11 +224,11 @@ export default {
}
// update--end--autor:lvdandan-----date:20201211------for:JT-118 【online】 日期、时间控件长度较小
})
return
this
.
_
innerColumns
return
this
.
innerColumns
},
// vxe 最终 editRules
vxeEditRules
()
{
return
Object
.
assign
({},
this
.
editRules
,
this
.
_
innerEditRules
)
return
Object
.
assign
({},
this
.
editRules
,
this
.
innerEditRules
)
},
// vxe 最终 props
vxeProps
()
{
...
...
@@ -302,8 +302,8 @@ export default {
this
.
$set
(
data
,
this
.
dragSortKey
,
idx
+
1
)
}
// 处理联动回显数据
if
(
this
.
_
innerLinkageConfig
!=
null
)
{
for
(
let
configItem
of
this
.
_
innerLinkageConfig
.
values
())
{
if
(
this
.
innerLinkageConfig
!=
null
)
{
for
(
let
configItem
of
this
.
innerLinkageConfig
.
values
())
{
this
.
autoSetLinkageOptionsByData
(
data
,
''
,
configItem
,
0
)
}
}
...
...
@@ -341,8 +341,8 @@ export default {
handler
(
columns
)
{
//获取不需要显示列
this
.
loadExcludeCode
()
let
_
innerColumns
=
[]
let
_
innerEditRules
=
{}
let
innerColumns
=
[]
let
innerEditRules
=
{}
let
{
rowNumber
,
rowSelection
,
rowExpand
,
dragSort
}
=
this
let
expandColumn
,
seqColumn
,
checkboxColumn
,
radioColumn
,
dragSortColumn
if
(
Array
.
isArray
(
columns
))
{
...
...
@@ -422,7 +422,7 @@ export default {
rules
.
push
(
Object
.
assign
({},
rule
,
replace
))
}
}
_
innerEditRules
[
col
.
key
]
=
rules
innerEditRules
[
col
.
key
]
=
rules
}
// 处理统计列
// sum = 求和、average = 平均值
...
...
@@ -435,7 +435,7 @@ export default {
}
})
}
_
innerColumns
.
push
(
col
)
innerColumns
.
push
(
col
)
}
})
}
...
...
@@ -445,7 +445,7 @@ export default {
if
(
seqColumn
)
{
col
=
Object
.
assign
(
col
,
seqColumn
,
{
type
:
'seq'
})
}
_
innerColumns
.
unshift
(
col
)
innerColumns
.
unshift
(
col
)
}
// 判断是否开启了可选择行
if
(
rowSelection
)
{
...
...
@@ -462,7 +462,7 @@ export default {
if
(
this
.
rowSelectionType
===
'checkbox'
&&
checkboxColumn
)
{
col
=
Object
.
assign
(
col
,
checkboxColumn
,
{
type
:
'checkbox'
})
}
_
innerColumns
.
unshift
(
col
)
innerColumns
.
unshift
(
col
)
}
// 是否可展开行
if
(
rowExpand
)
{
...
...
@@ -474,7 +474,7 @@ export default {
if
(
expandColumn
)
{
col
=
Object
.
assign
(
col
,
expandColumn
,
{
type
:
'expand'
})
}
_
innerColumns
.
unshift
(
col
)
innerColumns
.
unshift
(
col
)
}
// 是否可拖动排序
if
(
dragSort
)
{
...
...
@@ -486,11 +486,11 @@ export default {
if
(
dragSortColumn
)
{
col
=
Object
.
assign
(
col
,
dragSortColumn
,
{
type
:
JVXETypes
.
rowDragSort
})
}
_
innerColumns
.
unshift
(
col
)
innerColumns
.
unshift
(
col
)
}
this
.
_innerColumns
=
_
innerColumns
this
.
_innerEditRules
=
_
innerEditRules
this
.
innerColumns
=
innerColumns
this
.
innerEditRules
=
innerEditRules
}
},
// watch linkageConfig
...
...
@@ -501,7 +501,7 @@ export default {
if
(
Array
.
isArray
(
this
.
linkageConfig
)
&&
this
.
linkageConfig
.
length
>
0
)
{
// 获取联动的key顺序
let
getLcKeys
=
(
key
,
arr
)
=>
{
let
col
=
this
.
_
innerColumns
.
find
(
col
=>
col
.
key
===
key
)
let
col
=
this
.
innerColumns
.
find
(
col
=>
col
.
key
===
key
)
if
(
col
)
{
arr
.
push
(
col
.
key
)
if
(
col
.
linkageKey
)
{
...
...
@@ -520,9 +520,9 @@ export default {
}
keys
.
forEach
(
k
=>
configMap
.
set
(
k
,
configItem
))
})
this
.
_
innerLinkageConfig
=
configMap
this
.
innerLinkageConfig
=
configMap
}
else
{
this
.
_
innerLinkageConfig
=
null
this
.
innerLinkageConfig
=
null
}
}
},
...
...
@@ -734,8 +734,8 @@ export default {
this
.
$set
(
data
,
this
.
dragSortKey
,
idx
+
1
)
}
// 处理联动回显数据
if
(
this
.
_
innerLinkageConfig
!=
null
)
{
for
(
let
configItem
of
this
.
_
innerLinkageConfig
.
values
())
{
if
(
this
.
innerLinkageConfig
!=
null
)
{
for
(
let
configItem
of
this
.
innerLinkageConfig
.
values
())
{
this
.
autoSetLinkageOptionsByData
(
data
,
''
,
configItem
,
0
)
}
}
...
...
@@ -1253,10 +1253,10 @@ export default {
record
[
col
.
key
]
=
createValue
({
row
:
record
,
column
,
$table
:
xTable
})
}
// update-begin--author:sunjianlei---date:20210819------for: 处理联动列,联动列只能作用于 select 组件
if
(
col
.
$type
===
JVXETypes
.
select
&&
this
.
_
innerLinkageConfig
!=
null
)
{
if
(
col
.
$type
===
JVXETypes
.
select
&&
this
.
innerLinkageConfig
!=
null
)
{
// 判断当前列是否是联动列
if
(
this
.
_
innerLinkageConfig
.
has
(
col
.
key
))
{
let
configItem
=
this
.
_
innerLinkageConfig
.
get
(
col
.
key
)
if
(
this
.
innerLinkageConfig
.
has
(
col
.
key
))
{
let
configItem
=
this
.
innerLinkageConfig
.
get
(
col
.
key
)
this
.
getLinkageOptionsAsync
(
configItem
,
''
)
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论