切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
庄敏学
2 years ago
提交
f7780a1f400eca8eb5a6ed71c2a3601dae39d6fd
1 个父辈
d7f77bdf
导入增加定义列
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
12 行增加
和
3 行删除
go_build_main_go
pkg/domain/performance_application_form.go
pkg/port/beego/controllers/import_controller.go
go_build_main_go
查看文件 @
f7780a1
不能预览此文件类型
pkg/domain/performance_application_form.go
查看文件 @
f7780a1
...
...
@@ -11,6 +11,7 @@ type PerformanceApplicationForm struct {
Weight
string
//权重
Standard
string
//标准
Task
string
//任务、指标
Definition
string
//定义
}
type
PerformanceDimension
struct
{
...
...
@@ -27,6 +28,7 @@ type PerformanceModule struct {
type
PerformanceTarget
struct
{
Task
string
`json:"task"`
Definition
string
`json:"definition"`
}
func
LoadPerformanceDimensions
(
rows
[][]
string
)
([]
*
PerformanceDimension
,
error
)
{
...
...
@@ -59,6 +61,10 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error)
taskName
=
"填写自评反馈"
}
form
.
Task
=
taskName
//定义
if
len
(
item
)
>
5
{
form
.
Definition
=
strings
.
TrimSpace
(
item
[
5
])
}
//权重
if
len
(
item
)
>
6
&&
item
[
6
]
!=
""
{
weightName
=
item
[
6
]
...
...
@@ -199,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
查看文件 @
f7780a1
...
...
@@ -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
:
...
...
@@ -104,7 +107,7 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf
target
:=
module
.
Target
[
i3
]
nc
.
EntryItems
=
append
(
nc
.
EntryItems
,
&
domain
.
EntryItem
{
Title
:
target
.
Task
,
// 输入型标题
HintText
:
""
,
// 输入项提示文本
HintText
:
target
.
Definition
,
// 输入项提示文本
})
}
// 没有任何输入项时,默认1个
...
...
请
注册
或
登录
后发表评论