Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
0ced8ae5
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0ced8ae5
编写于
4月 23, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表格初始化组件优化
上级
cc0e9051
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
21 deletion
+21
-21
public/static/common/js/common.js
public/static/common/js/common.js
+21
-21
未找到文件。
public/static/common/js/common.js
浏览文件 @
0ced8ae5
...
...
@@ -1560,19 +1560,19 @@ function TableContainerInit()
if
(
$
(
'
.am-table-scrollable-horizontal
'
).
length
>
0
)
{
// th
$
(
'
.am-table-scrollable-horizontal
thead
tr
'
).
each
(
function
(
k
,
v
)
$
(
'
.am-table-scrollable-horizontal
> table > thead >
tr
'
).
each
(
function
(
k
,
v
)
{
// 第一列
if
(
$
(
this
).
parents
(
'
.am-table
'
).
hasClass
(
'
am-table-td-fixed-first
'
))
{
$
(
this
).
find
(
'
th:first
'
).
css
(
'
left
'
,
$
(
this
).
parents
(
'
.am-table
'
).
offset
().
left
);
$
(
this
).
find
(
'
>
th:first
'
).
css
(
'
left
'
,
$
(
this
).
parents
(
'
.am-table
'
).
offset
().
left
);
// 第一列自定义宽度->默认宽度,设置第二列 padding-left
var
first_width
=
$
(
this
).
find
(
'
th
'
).
first
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
th
'
).
first
().
innerWidth
();
var
first_width
=
$
(
this
).
find
(
'
>th
'
).
first
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
>
th
'
).
first
().
innerWidth
();
if
(
first_width
>
0
)
{
$
(
this
).
find
(
'
th
'
).
eq
(
1
).
css
(
'
min-width
'
,
((
$
(
this
).
find
(
'
th
'
).
eq
(
1
).
data
(
'
width
'
)
||
0
)
+
first_width
)
+
'
px
'
);
$
(
this
).
find
(
'
th
'
).
eq
(
1
).
css
(
'
padding-left
'
,
(
first_width
+
10
)
+
'
px
'
);
$
(
this
).
find
(
'
>th
'
).
eq
(
1
).
css
(
'
min-width
'
,
((
$
(
this
).
find
(
'
>
th
'
).
eq
(
1
).
data
(
'
width
'
)
||
0
)
+
first_width
)
+
'
px
'
);
$
(
this
).
find
(
'
>
th
'
).
eq
(
1
).
css
(
'
padding-left
'
,
(
first_width
+
10
)
+
'
px
'
);
}
}
...
...
@@ -1583,19 +1583,19 @@ function TableContainerInit()
var
width
=
$
(
document
.
body
).
width
();
var
left
=
$obj
.
offset
().
left
;
var
right
=
width
-
$obj
.
width
()
-
left
-
1
;
$
(
this
).
find
(
'
th:last
'
).
css
(
'
right
'
,
right
);
$
(
this
).
find
(
'
>
th:last
'
).
css
(
'
right
'
,
right
);
// 最后一列自定义宽度->默认宽度,设置倒数第二列 padding-right
var
last_width
=
$
(
this
).
find
(
'
th
'
).
last
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
th
'
).
last
().
innerWidth
();
var
last_width
=
$
(
this
).
find
(
'
>th
'
).
last
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
>
th
'
).
last
().
innerWidth
();
if
(
last_width
>
0
)
{
$
(
this
).
find
(
'
th
'
).
eq
(
-
2
).
css
(
'
min-width
'
,
((
$
(
this
).
find
(
'
th
'
).
eq
(
-
2
).
data
(
'
width
'
)
||
0
)
+
last_width
)
+
'
px
'
);
$
(
this
).
find
(
'
th
'
).
eq
(
-
2
).
css
(
'
padding-right
'
,
(
last_width
+
10
)
+
'
px
'
);
$
(
this
).
find
(
'
>th
'
).
eq
(
-
2
).
css
(
'
min-width
'
,
((
$
(
this
).
find
(
'
>
th
'
).
eq
(
-
2
).
data
(
'
width
'
)
||
0
)
+
last_width
)
+
'
px
'
);
$
(
this
).
find
(
'
>
th
'
).
eq
(
-
2
).
css
(
'
padding-right
'
,
(
last_width
+
10
)
+
'
px
'
);
}
}
// 是否自定义宽高
$
(
this
).
find
(
'
th
'
).
each
(
function
(
ks
,
vs
)
$
(
this
).
find
(
'
>
th
'
).
each
(
function
(
ks
,
vs
)
{
var
width
=
$
(
this
).
data
(
'
width
'
)
||
0
;
if
(
width
>
0
)
...
...
@@ -1611,7 +1611,7 @@ function TableContainerInit()
});
// td
$
(
'
.am-table-scrollable-horizontal
tbody
tr
'
).
each
(
function
(
k
,
v
)
$
(
'
.am-table-scrollable-horizontal
> table > tbody >
tr
'
).
each
(
function
(
k
,
v
)
{
// 容器
var
height
=
$
(
this
).
height
()
||
0
;
...
...
@@ -1624,18 +1624,18 @@ function TableContainerInit()
}
if
(
height
>
0
)
{
$
(
this
).
find
(
'
td
'
).
css
(
'
height
'
,
height
+
'
px
'
);
$
(
this
).
find
(
'
>
td
'
).
css
(
'
height
'
,
height
+
'
px
'
);
// 第一列
if
(
$
(
this
).
parents
(
'
.am-table
'
).
hasClass
(
'
am-table-td-fixed-first
'
))
{
$
(
this
).
find
(
'
td:first
'
).
css
(
'
left
'
,
$
(
this
).
parents
(
'
.am-table
'
).
offset
().
left
);
$
(
this
).
find
(
'
>
td:first
'
).
css
(
'
left
'
,
$
(
this
).
parents
(
'
.am-table
'
).
offset
().
left
);
// 第一列自定义宽度->默认宽度,设置第二列 padding-left
var
first_width
=
$
(
this
).
find
(
'
td
'
).
first
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
td
'
).
first
().
innerWidth
();
var
first_width
=
$
(
this
).
find
(
'
>td
'
).
first
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
>
td
'
).
first
().
innerWidth
();
if
(
first_width
>
0
)
{
$
(
this
).
find
(
'
td
'
).
eq
(
1
).
css
(
'
padding-left
'
,
(
first_width
+
10
)
+
'
px
'
);
$
(
this
).
find
(
'
>
td
'
).
eq
(
1
).
css
(
'
padding-left
'
,
(
first_width
+
10
)
+
'
px
'
);
}
}
...
...
@@ -1646,24 +1646,24 @@ function TableContainerInit()
var
width
=
$
(
document
.
body
).
width
();
var
left
=
$obj
.
offset
().
left
;
var
right
=
width
-
$obj
.
width
()
-
left
-
1
;
$
(
this
).
find
(
'
td:last
'
).
css
(
'
right
'
,
right
);
$
(
this
).
find
(
'
>
td:last
'
).
css
(
'
right
'
,
right
);
// 最后一列自定义宽度->默认宽度,设置倒数第二列 padding-right
var
last_width
=
$
(
this
).
find
(
'
td
'
).
last
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
td
'
).
last
().
innerWidth
();
var
last_width
=
$
(
this
).
find
(
'
>td
'
).
last
().
data
(
'
width
'
)
||
$
(
this
).
find
(
'
>
td
'
).
last
().
innerWidth
();
if
(
last_width
>
0
)
{
$
(
this
).
find
(
'
td
'
).
eq
(
-
2
).
css
(
'
padding-right
'
,
(
last_width
+
10
)
+
'
px
'
);
$
(
this
).
find
(
'
>
td
'
).
eq
(
-
2
).
css
(
'
padding-right
'
,
(
last_width
+
10
)
+
'
px
'
);
}
}
// 操作栏下容器高度
if
(
$
(
this
).
find
(
'
td.am-operate-grid .am-scrollable-vertical
'
).
length
>
0
)
if
(
$
(
this
).
find
(
'
>
td.am-operate-grid .am-scrollable-vertical
'
).
length
>
0
)
{
$
(
this
).
find
(
'
td.am-operate-grid .am-scrollable-vertical
'
).
css
(
'
height
'
,
(
height
-
1
)
+
'
px
'
);
$
(
this
).
find
(
'
>
td.am-operate-grid .am-scrollable-vertical
'
).
css
(
'
height
'
,
(
height
-
1
)
+
'
px
'
);
}
// 是否自定义宽高
$
(
this
).
find
(
'
td
'
).
each
(
function
(
ks
,
vs
)
$
(
this
).
find
(
'
>
td
'
).
each
(
function
(
ks
,
vs
)
{
var
width
=
$
(
this
).
data
(
'
width
'
)
||
0
;
if
(
width
>
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录