Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
zendata
提交
6f15ecf5
Z
zendata
项目概览
LinuxSuRen
/
zendata
与 Fork 源项目一致
Fork自
易企天创 / zendata
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f15ecf5
编写于
7月 24, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
close task #7497
上级
01e26e4f
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
48 addition
and
12 deletion
+48
-12
data/system/address/v1.xlsx
data/system/address/v1.xlsx
+0
-0
data/system/misc/timetamp.yaml
data/system/misc/timetamp.yaml
+0
-0
data/system/name/chinese-name.yaml
data/system/name/chinese-name.yaml
+0
-0
data/system/name/english-name.yaml
data/system/name/english-name.yaml
+0
-0
data/system/name/family-name.txt
data/system/name/family-name.txt
+0
-0
data/system/name/first-name.txt
data/system/name/first-name.txt
+0
-0
data/system/name/given-name.txt
data/system/name/given-name.txt
+0
-0
data/system/name/last-name.txt
data/system/name/last-name.txt
+0
-0
data/system/name/random-name.yaml
data/system/name/random-name.yaml
+0
-0
res/en/messages.json
res/en/messages.json
+1
-1
res/zh/messages.json
res/zh/messages.json
+1
-1
src/service/list.go
src/service/list.go
+46
-10
未找到文件。
data/system/address/v1.xlsx
浏览文件 @
6f15ecf5
无法预览此类型文件
data/system/misc/timetamp.yaml
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/chinese-name.yaml
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/english-name.yaml
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/family-name.txt
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/first-name.txt
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/given-name.txt
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/last-name.txt
已删除
100644 → 0
浏览文件 @
01e26e4f
data/system/name/random-name.yaml
已删除
100644 → 0
浏览文件 @
01e26e4f
res/en/messages.json
浏览文件 @
6f15ecf5
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
},
},
{
{
"id"
:
"excel_data"
,
"id"
:
"excel_data"
,
"translation"
:
"Excel
Data
."
"translation"
:
"Excel
Sheet
."
},
},
{
{
"id"
:
"excel_data_1"
,
"id"
:
"excel_data_1"
,
...
...
res/zh/messages.json
浏览文件 @
6f15ecf5
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
},
},
{
{
"id"
:
"excel_data"
,
"id"
:
"excel_data"
,
"translation"
:
"Excel数据
源
。"
"translation"
:
"Excel数据
表
。"
},
},
{
{
"id"
:
"excel_data_1"
,
"id"
:
"excel_data_1"
,
...
...
src/service/list.go
浏览文件 @
6f15ecf5
...
@@ -25,6 +25,7 @@ func ListRes() {
...
@@ -25,6 +25,7 @@ func ListRes() {
GetFilesAndDirs
(
path
,
&
res
)
GetFilesAndDirs
(
path
,
&
res
)
msg
:=
""
msg
:=
""
names
:=
make
([]
string
,
0
)
nameWidth
:=
0
nameWidth
:=
0
titleWidth
:=
0
titleWidth
:=
0
for
key
,
arr
:=
range
res
{
for
key
,
arr
:=
range
res
{
...
@@ -36,23 +37,51 @@ func ListRes() {
...
@@ -36,23 +37,51 @@ func ListRes() {
}
}
res
[
key
]
=
arr
res
[
key
]
=
arr
lent
:=
runewidth
.
StringWidth
(
arr
[
1
])
name
:=
pathToName
(
arr
[
1
])
names
=
append
(
names
,
name
)
lent
:=
runewidth
.
StringWidth
(
name
)
if
lent
>
nameWidth
{
if
lent
>
nameWidth
{
nameWidth
=
lent
nameWidth
=
lent
}
}
lent2
:=
runewidth
.
StringWidth
(
arr
[
2
])
if
lent2
>
titleWidth
{
if
key
==
"excel"
{
titleWidth
=
lent2
sheets
:=
strings
.
Split
(
arr
[
2
],
"|"
)
for
_
,
sheet
:=
range
sheets
{
lent2
:=
runewidth
.
StringWidth
(
sheet
)
if
lent2
>
titleWidth
{
titleWidth
=
lent2
}
}
}
else
{
lent2
:=
runewidth
.
StringWidth
(
arr
[
2
])
if
lent2
>
titleWidth
{
titleWidth
=
lent2
}
}
}
}
}
idx
:=
0
for
_
,
arr
:=
range
res
{
for
_
,
arr
:=
range
res
{
name
:=
arr
[
1
]
name
:=
names
[
idx
]
name
=
name
+
strings
.
Repeat
(
" "
,
nameWidth
-
runewidth
.
StringWidth
(
name
))
title
:=
arr
[
2
]
titleStr
:=
arr
[
2
]
title
=
title
+
strings
.
Repeat
(
" "
,
titleWidth
-
runewidth
.
StringWidth
(
title
))
titles
:=
strings
.
Split
(
titleStr
,
"|"
)
idx2
:=
0
for
_
,
title
:=
range
titles
{
if
idx2
>
0
{
name
=
""
}
name
=
name
+
strings
.
Repeat
(
" "
,
nameWidth
-
runewidth
.
StringWidth
(
name
))
title
=
title
+
strings
.
Repeat
(
" "
,
titleWidth
-
runewidth
.
StringWidth
(
title
))
msg
=
msg
+
fmt
.
Sprintf
(
"%s %s %s
\n
"
,
name
,
title
,
arr
[
3
])
idx2
++
}
msg
=
msg
+
fmt
.
Sprintf
(
"%s %s %s
\n
"
,
name
,
title
,
arr
[
3
])
idx
++
}
}
logUtils
.
Screen
(
msg
)
logUtils
.
Screen
(
msg
)
...
@@ -70,7 +99,7 @@ func GetFilesAndDirs(path string, res *map[string][size]string) {
...
@@ -70,7 +99,7 @@ func GetFilesAndDirs(path string, res *map[string][size]string) {
}
else
{
}
else
{
name
:=
fi
.
Name
()
name
:=
fi
.
Name
()
arr
:=
[
size
]
string
{}
arr
:=
[
size
]
string
{}
if
strings
.
HasSuffix
(
name
,
".yaml"
){
if
strings
.
HasSuffix
(
name
,
".yaml"
)
{
arr
[
0
]
=
path
+
constant
.
PthSep
+
name
arr
[
0
]
=
path
+
constant
.
PthSep
+
name
arr
[
1
]
=
path
[
strings
.
LastIndex
(
path
,
"system"
)
:
]
+
constant
.
PthSep
+
name
arr
[
1
]
=
path
[
strings
.
LastIndex
(
path
,
"system"
)
:
]
+
constant
.
PthSep
+
name
(
*
res
)[
"yaml"
]
=
arr
(
*
res
)[
"yaml"
]
=
arr
...
@@ -118,4 +147,11 @@ func readExcelInfo(path string) (title string, desc string) {
...
@@ -118,4 +147,11 @@ func readExcelInfo(path string) (title string, desc string) {
desc
=
i118Utils
.
I118Prt
.
Sprintf
(
"excel_data"
)
desc
=
i118Utils
.
I118Prt
.
Sprintf
(
"excel_data"
)
return
return
}
func
pathToName
(
path
string
)
string
{
name
:=
strings
.
ReplaceAll
(
path
,
constant
.
PthSep
,
"."
)
name
=
name
[
:
strings
.
LastIndex
(
name
,
"."
)]
return
name
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录