Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
11ada2fd
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1428
Star
162
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
11ada2fd
编写于
6月 15, 2024
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 表格组件修改
上级
054319c6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
2 deletion
+17
-2
web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js
...ssets/lib/layui/customer/tableUtil/initTableChooseUtil.js
+17
-2
未找到文件。
web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js
浏览文件 @
11ada2fd
...
@@ -56,22 +56,37 @@ var initTableChooseUtil = {
...
@@ -56,22 +56,37 @@ var initTableChooseUtil = {
'
</div>
'
+
'
</div>
'
+
'
</div>
'
+
'
</div>
'
+
'
<div class="layui-form-mid layui-word-aux" style="width: 100%">
'
+
newOptions
.
placeholder
+
'
</div>
'
+
'
<div class="layui-form-mid layui-word-aux" style="width: 100%">
'
+
newOptions
.
placeholder
+
'
</div>
'
+
'
<div style="width: 100%; overflow-x: auto;">
'
+
'
<table class="layui-table" style="width: auto">
'
+
'
<table class="layui-table" style="width: auto">
'
+
'
<thead>
'
+
'
<thead>
'
+
'
<tr id="header
'
+
newOptions
.
id
+
'
"></tr>
'
+
'
<tr id="header
'
+
newOptions
.
id
+
'
"></tr>
'
+
'
</thead>
'
+
'
</thead>
'
+
'
<tbody id="table
'
+
newOptions
.
id
+
'
" class="insurance-table">
'
+
'
<tbody id="table
'
+
newOptions
.
id
+
'
" class="insurance-table">
'
+
'
</tbody>
'
+
'
</tbody>
'
+
'
</table>
'
;
'
</table>
'
+
'
</div>
'
;
$
(
"
#
"
+
newOptions
.
id
).
html
(
table
);
$
(
"
#
"
+
newOptions
.
id
).
html
(
table
);
var
headerStr
=
'
<th style="width: 30px;"></th>
'
;
var
headerStr
=
'
<th style="width: 30px;"></th>
'
;
var
fontSize
=
14
;
$
.
each
(
newOptions
.
cols
,
function
(
i
,
item
)
{
$
.
each
(
newOptions
.
cols
,
function
(
i
,
item
)
{
var
colHeaderId
=
isNull
(
item
.
colHeaderId
)
?
""
:
(
"
id =
"
+
item
.
colHeaderId
);
var
colHeaderId
=
isNull
(
item
.
colHeaderId
)
?
""
:
(
"
id =
"
+
item
.
colHeaderId
);
var
bs
=
''
;
var
bs
=
''
;
if
(
!
isNull
(
item
.
verify
)
&&
item
.
verify
.
indexOf
(
'
required
'
)
>=
0
)
{
if
(
!
isNull
(
item
.
verify
)
&&
item
.
verify
.
indexOf
(
'
required
'
)
>=
0
)
{
bs
=
'
<i class="red">*</i>
'
;
bs
=
'
<i class="red">*</i>
'
;
}
}
headerStr
+=
'
<th style="width:
'
+
item
.
width
+
'
px; white-space: nowrap;"
'
+
colHeaderId
+
'
>
'
+
item
.
title
+
bs
+
'
</th>
'
;
// 计算需要添加几个空格
// 1. 获取文字的宽度
let
titleWidth
=
fontSize
*
item
.
title
.
length
;
// 2. 获取空格宽度
let
spaceWidth
=
(
item
.
width
-
titleWidth
)
/
2
;
let
spaceStr
=
''
;
if
(
spaceWidth
>
0
)
{
// 每个空格的宽度默认是2px
for
(
var
i
=
0
;
i
<
spaceWidth
/
4
;
i
++
)
{
spaceStr
+=
'
'
;
}
}
headerStr
+=
'
<th style="width:
'
+
item
.
width
+
'
px; white-space: nowrap;"
'
+
colHeaderId
+
'
>
'
+
spaceStr
+
item
.
title
+
bs
+
spaceStr
+
'
</th>
'
;
});
});
$
(
"
#header
"
+
newOptions
.
id
).
html
(
headerStr
);
$
(
"
#header
"
+
newOptions
.
id
).
html
(
headerStr
);
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录