Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
97eff9f6
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,发现更多精彩内容 >>
提交
97eff9f6
编写于
3月 10, 2021
作者:
陈
陈琦
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issues
上级
c414e03d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
160 addition
and
78 deletion
+160
-78
src/gen/charVal.go
src/gen/charVal.go
+77
-28
src/gen/floatVal.go
src/gen/floatVal.go
+80
-33
src/gen/list.go
src/gen/list.go
+1
-1
test/test.yaml
test/test.yaml
+1
-1
ui/src/views/data/mine/Edit.vue
ui/src/views/data/mine/Edit.vue
+0
-1
ui/src/views/data/mine/List.vue
ui/src/views/data/mine/List.vue
+1
-1
users/test/dir/content.yaml
users/test/dir/content.yaml
+0
-13
未找到文件。
src/gen/charVal.go
浏览文件 @
97eff9f6
...
...
@@ -5,67 +5,116 @@ import (
constant
"github.com/easysoft/zendata/src/utils/const"
)
func
GenerateByteItems
(
start
byte
,
end
byte
,
step
int
,
rand
bool
,
repeat
int
,
t
ag
string
)
[]
interface
{}
{
func
GenerateByteItems
(
start
byte
,
end
byte
,
step
int
,
rand
bool
,
repeat
int
,
repeatT
ag
string
)
[]
interface
{}
{
if
!
rand
{
return
generateByteItemsByStep
(
start
,
end
,
step
,
repeat
)
return
generateByteItemsByStep
(
start
,
end
,
step
,
repeat
,
repeatTag
)
}
else
{
return
generateByteItemsRand
(
start
,
end
,
step
,
repeat
)
return
generateByteItemsRand
(
start
,
end
,
step
,
repeat
,
repeatTag
)
}
}
func
generateByteItemsByStep
(
start
byte
,
end
byte
,
step
int
,
repeat
int
)
[]
interface
{}
{
func
generateByteItemsByStep
(
start
byte
,
end
byte
,
step
int
,
repeat
int
,
repeatTag
string
)
[]
interface
{}
{
arr
:=
make
([]
interface
{},
0
)
total
:=
0
for
i
:=
0
;
true
;
{
val
:=
start
+
byte
(
int
(
i
)
*
step
)
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
if
repeatTag
==
""
{
for
i
:=
0
;
true
;
{
val
:=
start
+
byte
(
int
(
i
)
*
step
)
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
}
else
if
repeatTag
==
"!"
{
for
round
:=
0
;
round
<
repeat
;
round
++
{
for
i
:=
0
;
true
;
{
val
:=
start
+
byte
(
int
(
i
)
*
step
)
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
if
total
>
constant
.
MaxNumb
{
break
arr
=
append
(
arr
,
val
)
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
i
++
}
return
arr
}
func
generateByteItemsRand
(
start
byte
,
end
byte
,
step
int
,
repeat
int
)
[]
interface
{}
{
func
generateByteItemsRand
(
start
byte
,
end
byte
,
step
int
,
repeat
int
,
repeatTag
string
)
[]
interface
{}
{
arr
:=
make
([]
interface
{},
0
)
countInRound
:=
(
int
(
end
)
-
int
(
start
))
/
step
total
:=
0
for
i
:=
0
;
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum
(
countInRound
)
if
step
<
0
{
rand
=
rand
*
-
1
}
val
:=
start
+
byte
(
rand
)
if
repeatTag
==
""
{
for
i
:=
0
;
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum
(
countInRound
)
if
step
<
0
{
rand
=
rand
*
-
1
}
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
val
:=
start
+
byte
(
rand
)
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
}
else
if
repeatTag
==
"!"
{
for
round
:=
0
;
round
<
repeat
;
round
++
{
for
i
:=
0
;
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum
(
countInRound
)
if
step
<
0
{
rand
=
rand
*
-
1
}
if
total
>
constant
.
MaxNumb
{
break
val
:=
start
+
byte
(
rand
)
arr
=
append
(
arr
,
val
)
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
i
++
}
return
arr
...
...
src/gen/floatVal.go
浏览文件 @
97eff9f6
...
...
@@ -7,82 +7,129 @@ import (
"strings"
)
func
GenerateFloatItems
(
start
float64
,
end
float64
,
step
interface
{},
rand
bool
,
repeat
int
,
t
ag
string
)
[]
interface
{}
{
func
GenerateFloatItems
(
start
float64
,
end
float64
,
step
interface
{},
rand
bool
,
precision
,
repeat
int
,
repeatT
ag
string
)
[]
interface
{}
{
if
!
rand
{
return
generateFloatItemsByStep
(
start
,
end
,
step
.
(
float64
),
repeat
)
return
generateFloatItemsByStep
(
start
,
end
,
step
.
(
float64
),
precision
,
repeat
,
repeatTag
)
}
else
{
return
generateFloatItemsRand
(
start
,
end
,
step
.
(
float64
),
repeat
)
return
generateFloatItemsRand
(
start
,
end
,
step
.
(
float64
),
precision
,
repeat
,
repeatTag
)
}
}
func
generateFloatItemsByStep
(
start
float64
,
end
float64
,
step
float64
,
repeat
int
)
[]
interface
{}
{
func
generateFloatItemsByStep
(
start
float64
,
end
float64
,
step
float64
,
precision
,
repeat
int
,
repeatTag
string
)
[]
interface
{}
{
arr
:=
make
([]
interface
{},
0
)
total
:=
0
for
i
:=
0
;
true
;
{
val
:=
start
+
float64
(
i
)
*
step
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
if
repeatTag
==
""
{
for
i
:=
0
;
true
;
{
val
:=
start
+
float64
(
i
)
*
step
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
}
else
if
repeatTag
==
"!"
{
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
for
i
:=
0
;
true
;
{
val
:=
start
+
float64
(
i
)
*
step
if
(
val
>
end
&&
step
>
0
)
||
(
val
<
end
&&
step
<
0
)
{
break
}
arr
=
append
(
arr
,
val
)
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
return
arr
}
func
generateFloatItemsRand
(
start
float64
,
end
float64
,
step
float64
,
repeat
int
)
[]
interface
{}
{
func
generateFloatItemsRand
(
start
float64
,
end
float64
,
step
float64
,
precision
,
repeat
int
,
repeatTag
string
)
[]
interface
{}
{
arr
:=
make
([]
interface
{},
0
)
countInRound
:=
(
end
-
start
)
/
step
total
:=
0
for
i
:=
float64
(
0
);
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum64
(
int64
(
countInRound
))
if
step
<
0
{
rand
=
rand
*
-
1
}
val
:=
start
+
float64
(
rand
)
*
step
if
repeatTag
==
""
{
for
i
:=
float64
(
0
);
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum64
(
int64
(
countInRound
))
if
step
<
0
{
rand
=
rand
*
-
1
}
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
val
:=
start
+
float64
(
rand
)
*
step
for
round
:=
0
;
round
<
repeat
;
round
++
{
arr
=
append
(
arr
,
val
)
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
total
++
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
}
else
if
repeatTag
==
"!"
{
for
round
:=
0
;
round
<
repeat
;
round
++
{
for
i
:=
float64
(
0
);
i
<
countInRound
;
{
rand
:=
commonUtils
.
RandNum64
(
int64
(
countInRound
))
if
step
<
0
{
rand
=
rand
*
-
1
}
val
:=
start
+
float64
(
rand
)
*
step
arr
=
append
(
arr
,
val
)
if
total
>
constant
.
MaxNumb
{
break
}
i
++
}
if
total
>
constant
.
MaxNumb
{
break
total
++
if
total
>
constant
.
MaxNumb
{
break
}
}
i
++
}
return
arr
}
func
GetPrecision
(
base
float64
,
step
interface
{})
(
precision
int
,
newStep
float64
)
{
val
:=
base
if
step
!=
nil
{
val
+=
step
.
(
float64
)
var
flt
float64
=
1
if
step
==
nil
{
step
=
flt
}
str1
:=
strconv
.
FormatFloat
(
base
,
'f'
,
-
1
,
64
)
str2
:=
strconv
.
FormatFloat
(
val
,
'f'
,
-
1
,
64
)
str2
:=
strconv
.
FormatFloat
(
step
.
(
float64
)
,
'f'
,
-
1
,
64
)
index1
:=
strings
.
LastIndex
(
str1
,
"."
)
index2
:=
strings
.
LastIndex
(
str2
,
"."
)
...
...
src/gen/list.go
浏览文件 @
97eff9f6
...
...
@@ -240,7 +240,7 @@ func CreateValuesFromInterval(field *model.DefField, desc, stepStr string, repea
endFloat
,
_
:=
strconv
.
ParseFloat
(
endStr
,
64
)
field
.
Precision
=
precision
items
=
GenerateFloatItems
(
startFloat
,
endFloat
,
step
,
rand
,
repeat
,
repeatTag
)
items
=
GenerateFloatItems
(
startFloat
,
endFloat
,
step
,
rand
,
precision
,
repeat
,
repeatTag
)
}
else
if
dataType
==
"char"
{
items
=
GenerateByteItems
(
startStr
[
0
],
endStr
[
0
],
step
.
(
int
),
rand
,
repeat
,
repeatTag
)
...
...
test/test.yaml
浏览文件 @
97eff9f6
...
...
@@ -3,7 +3,7 @@ desc: 描述
version
:
1.0
fields
:
-
field
:
field_length
range
:
1
-3{2!}
range
:
1
.11-1.13:0.001
length
:
3
leftpad
:
0
prefix
:
"
+"
...
...
ui/src/views/data/mine/Edit.vue
浏览文件 @
97eff9f6
...
...
@@ -75,7 +75,6 @@ export default {
},
watch
:
{
id
:
function
()
{
console
.
log
(
'
watch id
'
+
this
.
id
)
this
.
loadData
();
}
},
...
...
ui/src/views/data/mine/List.vue
浏览文件 @
97eff9f6
...
...
@@ -159,7 +159,7 @@ export default {
})
},
create
()
{
this
.
editRecord
=
null
;
this
.
editRecord
=
{}
;
this
.
editModalVisible
=
true
;
},
edit
(
record
)
{
...
...
users/test/dir/content.yaml
已删除
100644 → 0
浏览文件 @
c414e03d
title
:
被引用测试
desc
:
"
"
fields
:
-
field
:
field1
range
:
'
`fd`'
prefix
:
'
['
postfix
:
"
]
\t
"
-
field
:
新字段
fields
:
-
field
:
新字段
range
:
0-9,0-9,0-9{11}
from
:
zentao.number.v1.yaml
use
:
small{0}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录