切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
09a2d06c1493860402361b97d3cd8b7108868738
2 个父辈
73f79179
f7780a1f
master
...
dev-pushdata
dev-tangxvhui
dev-zhengzhou
test
v1.3.2-fix
v1.4.0
v2.2.0-fix
20230410
20230403
20230331
20230324
20230315
20230203
20230112
20221208
20221205
v2.2.0
v2.0.0
v1.3.2
v1.3.2-fix
v1.3.1
v1.3.0
v1.2.4
Merge branch 'test' of
http://gitlab.fjmaimaimai.com/allied-creation/performance
into test
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
21 行增加
和
5 行删除
go_build_main_go
pkg/domain/performance_application_form.go
pkg/port/beego/controllers/import_controller.go
go_build_main_go
查看文件 @
09a2d06
不能预览此文件类型
pkg/domain/performance_application_form.go
查看文件 @
09a2d06
...
...
@@ -11,6 +11,7 @@ type PerformanceApplicationForm struct {
Weight
string
//权重
Standard
string
//标准
Task
string
//任务、指标
Definition
string
//定义
}
type
PerformanceDimension
struct
{
...
...
@@ -26,7 +27,8 @@ type PerformanceModule struct {
}
type
PerformanceTarget
struct
{
Task
string
`json:"task"`
Task
string
`json:"task"`
Definition
string
`json:"definition"`
}
func
LoadPerformanceDimensions
(
rows
[][]
string
)
([]
*
PerformanceDimension
,
error
)
{
...
...
@@ -55,8 +57,14 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error)
//指标任务
if
len
(
item
)
>
4
&&
item
[
4
]
!=
""
{
taskName
=
item
[
4
]
}
else
{
taskName
=
"填写自评反馈"
}
form
.
Task
=
taskName
//定义
if
len
(
item
)
>
5
{
form
.
Definition
=
strings
.
TrimSpace
(
item
[
5
])
}
//权重
if
len
(
item
)
>
6
&&
item
[
6
]
!=
""
{
weightName
=
item
[
6
]
...
...
@@ -66,6 +74,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error)
if
len
(
item
)
>
7
&&
item
[
7
]
!=
""
{
standardName
=
item
[
7
]
}
if
key
<
len
(
rows
)
-
1
{
if
len
(
rows
[
key
+
1
])
>
1
&&
rows
[
key
+
1
][
1
]
!=
""
{
standardName
=
""
}
}
form
.
Standard
=
standardName
formRows
=
append
(
formRows
,
form
)
}
...
...
@@ -192,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) {
func
getTasks
(
items
[]
*
PerformanceApplicationForm
)
([]
*
PerformanceTarget
,
error
)
{
tasks
:=
make
([]
*
PerformanceTarget
,
0
)
for
_
,
item
:=
range
items
{
target
:=
&
PerformanceTarget
{
Task
:
item
.
Task
}
target
:=
&
PerformanceTarget
{
Task
:
item
.
Task
,
Definition
:
item
.
Definition
}
tasks
=
append
(
tasks
,
target
)
}
return
tasks
,
nil
...
...
pkg/port/beego/controllers/import_controller.go
查看文件 @
09a2d06
...
...
@@ -41,7 +41,10 @@ func (controller *ImportController) Import() {
formType
:=
controller
.
GetString
(
"type"
)
switch
formType
{
case
"PerformanceDimension"
:
dimensions
,
_
:=
domain
.
LoadPerformanceDimensions
(
rows
)
dimensions
,
err
:=
domain
.
LoadPerformanceDimensions
(
rows
)
if
err
!=
nil
{
controller
.
Response
(
nil
,
application
.
ThrowError
(
application
.
ARG_ERROR
,
err
.
Error
()))
}
list
:=
controller
.
parseTemplateNodeContent
(
dimensions
)
controller
.
Response
(
tool_funs
.
SimpleWrapGridMap
(
int64
(
len
(
list
)),
list
),
nil
)
default
:
...
...
@@ -103,8 +106,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf
for
i3
:=
range
module
.
Target
{
target
:=
module
.
Target
[
i3
]
nc
.
EntryItems
=
append
(
nc
.
EntryItems
,
&
domain
.
EntryItem
{
Title
:
target
.
Task
,
// 输入型标题
HintText
:
""
,
// 输入项提示文本
Title
:
target
.
Task
,
// 输入型标题
HintText
:
target
.
Definition
,
// 输入项提示文本
})
}
// 没有任何输入项时,默认1个
...
...
请
注册
或
登录
后发表评论