作者 庄敏学

导入增加定义列

不能预览此文件类型
... ... @@ -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
... ...
... ... @@ -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个
... ...