Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
7b46fb1d
Z
zendata
项目概览
易企天创
/
zendata
11 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
GitCode(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7b46fb1d
编写于
11月 24, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert refer path related to current zendata work dir
上级
91b8b740
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
5 deletion
+27
-5
src/server/service/def.go
src/server/service/def.go
+6
-2
src/utils/file/file.go
src/utils/file/file.go
+5
-0
tmp/cache/.data.db
tmp/cache/.data.db
+0
-0
ui/src/components/FieldRefer.vue
ui/src/components/FieldRefer.vue
+1
-1
users/test/_test-data.yaml
users/test/_test-data.yaml
+2
-2
users/test/dir/content.yaml
users/test/dir/content.yaml
+10
-0
users/test/dir/users.txt
users/test/dir/users.txt
+3
-0
未找到文件。
src/server/service/def.go
浏览文件 @
7b46fb1d
...
...
@@ -185,8 +185,10 @@ func (s *DefService) saveFieldToDB(item *model.ZdField, currPath string, parentI
if
len
(
rangeSections
)
==
1
{
rangeSection
:=
rangeSections
[
0
]
desc
,
_
,
count
:=
gen
.
ParseRangeSection
(
rangeSection
)
refer
.
File
=
desc
refer
.
Count
=
count
path
:=
FileToPath
(
desc
,
currPath
)
refer
.
File
=
strings
.
Replace
(
path
,
vari
.
WorkDir
,
""
,
1
)
}
}
else
if
item
.
Select
!=
""
{
// refer to excel
...
...
@@ -220,8 +222,10 @@ func (s *DefService) saveFieldToDB(item *model.ZdField, currPath string, parentI
refer
.
Type
=
constant
.
ResTypeYaml
}
if
path
.
Ext
(
desc
)
==
".txt"
||
path
.
Ext
(
desc
)
==
".yaml"
{
refer
.
File
=
desc
refer
.
Count
=
count
path
:=
FileToPath
(
desc
,
currPath
)
refer
.
File
=
strings
.
Replace
(
path
,
vari
.
WorkDir
,
""
,
1
)
}
}
}
...
...
src/utils/file/file.go
浏览文件 @
7b46fb1d
...
...
@@ -273,6 +273,11 @@ func ConvertResExcelPath(from string) (ret, sheet string) {
return
}
func
ConvertResTextPath
(
from
string
)
(
ret
string
)
{
return
}
func
GetFilesByExtInDir
(
folder
,
ext
string
,
files
*
[]
string
)
{
folder
,
_
=
filepath
.
Abs
(
folder
)
...
...
tmp/cache/.data.db
浏览文件 @
7b46fb1d
无法预览此类型文件
ui/src/components/FieldRefer.vue
浏览文件 @
7b46fb1d
...
...
@@ -18,7 +18,7 @@
<a-form-model-item
label=
"文件"
prop=
"file"
:labelCol=
"labelColFull"
:wrapperCol=
"wrapperColFull"
>
<a-select
v-model=
"refer.file"
@
change=
"onReferFileChanged"
>
<a-select-option
value=
""
>
选择
</a-select-option>
<a-select-option
v-for=
"(f, i) in files"
:value=
"f.
id
"
:key=
"i"
>
<a-select-option
v-for=
"(f, i) in files"
:value=
"f.
referName
"
:key=
"i"
>
{{
f
.
title
}}
</a-select-option>
</a-select>
...
...
users/test/_test-data.yaml
浏览文件 @
7b46fb1d
...
...
@@ -19,11 +19,11 @@ fields:
# range: 10-20
# prefix: int_
-
field
:
field_text
# 从一个文件中随机读取。
range
:
users.txt:R
# 相对当前文件路径。
range
:
dir/
users.txt:R
# 相对当前文件路径。
postfix
:
"
\t
"
-
field
:
field_yaml
# 引用其他的定义文件整体内容。
range
:
test/test-nested2
.yaml{3}
# 相对当前文件路径。
range
:
dir/content
.yaml{3}
# 相对当前文件路径。
postfix
:
"
\t
"
-
field
:
field_use_config
# 引用其他的config定义文件。
...
...
users/test/dir/content.yaml
0 → 100644
浏览文件 @
7b46fb1d
title
:
内容被引用
desc
:
author
:
zentao
version
:
1.0
fields
:
-
field
:
field1
range
:
1-10
prefix
:
"
"
postfix
:
"
\t
"
users/test/dir/users.txt
0 → 100644
浏览文件 @
7b46fb1d
aaron
ben
carl
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录