正在显示
3 个修改的文件
包含
12 行增加
和
3 行删除
不能预览此文件类型
@@ -11,6 +11,7 @@ type PerformanceApplicationForm struct { | @@ -11,6 +11,7 @@ type PerformanceApplicationForm struct { | ||
11 | Weight string //权重 | 11 | Weight string //权重 |
12 | Standard string //标准 | 12 | Standard string //标准 |
13 | Task string //任务、指标 | 13 | Task string //任务、指标 |
14 | + Definition string //定义 | ||
14 | } | 15 | } |
15 | 16 | ||
16 | type PerformanceDimension struct { | 17 | type PerformanceDimension struct { |
@@ -27,6 +28,7 @@ type PerformanceModule struct { | @@ -27,6 +28,7 @@ type PerformanceModule struct { | ||
27 | 28 | ||
28 | type PerformanceTarget struct { | 29 | type PerformanceTarget struct { |
29 | Task string `json:"task"` | 30 | Task string `json:"task"` |
31 | + Definition string `json:"definition"` | ||
30 | } | 32 | } |
31 | 33 | ||
32 | func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) { | 34 | func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) { |
@@ -59,6 +61,10 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) | @@ -59,6 +61,10 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) | ||
59 | taskName = "填写自评反馈" | 61 | taskName = "填写自评反馈" |
60 | } | 62 | } |
61 | form.Task = taskName | 63 | form.Task = taskName |
64 | + //定义 | ||
65 | + if len(item) > 5 { | ||
66 | + form.Definition = strings.TrimSpace(item[5]) | ||
67 | + } | ||
62 | //权重 | 68 | //权重 |
63 | if len(item) > 6 && item[6] != "" { | 69 | if len(item) > 6 && item[6] != "" { |
64 | weightName = item[6] | 70 | weightName = item[6] |
@@ -199,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { | @@ -199,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { | ||
199 | func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { | 205 | func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { |
200 | tasks := make([]*PerformanceTarget, 0) | 206 | tasks := make([]*PerformanceTarget, 0) |
201 | for _, item := range items { | 207 | for _, item := range items { |
202 | - target := &PerformanceTarget{Task: item.Task} | 208 | + target := &PerformanceTarget{Task: item.Task, Definition: item.Definition} |
203 | tasks = append(tasks, target) | 209 | tasks = append(tasks, target) |
204 | } | 210 | } |
205 | return tasks, nil | 211 | return tasks, nil |
@@ -41,7 +41,10 @@ func (controller *ImportController) Import() { | @@ -41,7 +41,10 @@ func (controller *ImportController) Import() { | ||
41 | formType := controller.GetString("type") | 41 | formType := controller.GetString("type") |
42 | switch formType { | 42 | switch formType { |
43 | case "PerformanceDimension": | 43 | case "PerformanceDimension": |
44 | - dimensions, _ := domain.LoadPerformanceDimensions(rows) | 44 | + dimensions, err := domain.LoadPerformanceDimensions(rows) |
45 | + if err != nil { | ||
46 | + controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error())) | ||
47 | + } | ||
45 | list := controller.parseTemplateNodeContent(dimensions) | 48 | list := controller.parseTemplateNodeContent(dimensions) |
46 | controller.Response(tool_funs.SimpleWrapGridMap(int64(len(list)), list), nil) | 49 | controller.Response(tool_funs.SimpleWrapGridMap(int64(len(list)), list), nil) |
47 | default: | 50 | default: |
@@ -104,7 +107,7 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf | @@ -104,7 +107,7 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf | ||
104 | target := module.Target[i3] | 107 | target := module.Target[i3] |
105 | nc.EntryItems = append(nc.EntryItems, &domain.EntryItem{ | 108 | nc.EntryItems = append(nc.EntryItems, &domain.EntryItem{ |
106 | Title: target.Task, // 输入型标题 | 109 | Title: target.Task, // 输入型标题 |
107 | - HintText: "", // 输入项提示文本 | 110 | + HintText: target.Definition, // 输入项提示文本 |
108 | }) | 111 | }) |
109 | } | 112 | } |
110 | // 没有任何输入项时,默认1个 | 113 | // 没有任何输入项时,默认1个 |
-
请 注册 或 登录 后发表评论