作者 tangxvhui
不能预览此文件类型
@@ -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 {
@@ -26,7 +27,8 @@ type PerformanceModule struct { @@ -26,7 +27,8 @@ type PerformanceModule struct {
26 } 27 }
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) {
@@ -55,8 +57,14 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) @@ -55,8 +57,14 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error)
55 //指标任务 57 //指标任务
56 if len(item) > 4 && item[4] != "" { 58 if len(item) > 4 && item[4] != "" {
57 taskName = item[4] 59 taskName = item[4]
  60 + } else {
  61 + taskName = "填写自评反馈"
58 } 62 }
59 form.Task = taskName 63 form.Task = taskName
  64 + //定义
  65 + if len(item) > 5 {
  66 + form.Definition = strings.TrimSpace(item[5])
  67 + }
60 //权重 68 //权重
61 if len(item) > 6 && item[6] != "" { 69 if len(item) > 6 && item[6] != "" {
62 weightName = item[6] 70 weightName = item[6]
@@ -66,6 +74,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) @@ -66,6 +74,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error)
66 if len(item) > 7 && item[7] != "" { 74 if len(item) > 7 && item[7] != "" {
67 standardName = item[7] 75 standardName = item[7]
68 } 76 }
  77 + if key < len(rows)-1 {
  78 + if len(rows[key+1]) > 1 && rows[key+1][1] != "" {
  79 + standardName = ""
  80 + }
  81 + }
69 form.Standard = standardName 82 form.Standard = standardName
70 formRows = append(formRows, form) 83 formRows = append(formRows, form)
71 } 84 }
@@ -192,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { @@ -192,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) {
192 func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { 205 func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) {
193 tasks := make([]*PerformanceTarget, 0) 206 tasks := make([]*PerformanceTarget, 0)
194 for _, item := range items { 207 for _, item := range items {
195 - target := &PerformanceTarget{Task: item.Task} 208 + target := &PerformanceTarget{Task: item.Task, Definition: item.Definition}
196 tasks = append(tasks, target) 209 tasks = append(tasks, target)
197 } 210 }
198 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:
@@ -103,8 +106,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf @@ -103,8 +106,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf
103 for i3 := range module.Target { 106 for i3 := range module.Target {
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, // 输入型标题  
107 - HintText: "", // 输入项提示文本 109 + Title: target.Task, // 输入型标题
  110 + HintText: target.Definition, // 输入项提示文本
108 }) 111 })
109 } 112 }
110 // 没有任何输入项时,默认1个 113 // 没有任何输入项时,默认1个