作者 tangxvhui

导出 修改

... ... @@ -42,9 +42,9 @@ type AuditFormValueList struct {
//输入框类型
const (
InputTypeText string = "text" //单行文本宽
InputTypeRadio string = "radio" //单选框
InputTypeImageVedio string = "image/video" // 图片或视频输入
InputTypeText string = "text" //单行文本宽
InputTypeRadio string = "radio" //单选框
InputTypeImageVedio string = "files" // 图片或视频输入
)
//输入框输入的数据类型
... ...
... ... @@ -31,8 +31,6 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
return nil, nil
}
//https://web-open.fjmaimaimai.com/#/ 生产
// mmm-web-open-test.fjmaimaimai.com/
// SELECT a.id,a.department_id,a.audit_template_id,a.chance_type_id
// ,a.publish_status,a.create_at,a.review_status,a.status
// ,a.discovery_score,a.comment_total ,a.code,d.nick_name,d.id as user_id
... ... @@ -115,10 +113,25 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
err := json.Unmarshal([]byte(soureContentJson), &soureContentData)
if err == nil {
for ii := range soureContentData {
valueString := strings.TrimSpace(soureContentData[ii].CurrentValue)
if len(valueString) == 0 {
if soureContentData[ii].InputType == models.InputTypeImageVedio {
continue
}
var valueString string
if soureContentData[ii].InputType == models.InputTypeText {
valueString = strings.TrimSpace(soureContentData[ii].CurrentValue)
if len(valueString) == 0 {
continue
}
}
if soureContentData[ii].InputType == models.InputTypeRadio {
if len(soureContentData[ii].Data) == 0 {
continue
}
valueString = strings.TrimSpace(soureContentData[ii].Data[0].Value)
if len(valueString) == 0 {
continue
}
}
soureContentText.WriteString(soureContentData[ii].Label + ":" + valueString + ",")
}
}
... ... @@ -126,9 +139,9 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
signString := signature.SignaString(fmt.Sprint(soureData[i]["id"]))
var frontHost string
if "prod" == myconfig.MConfig.ConfigName {
frontHost = "https://web-open.fjmaimaimai.com/#/ability/opportunity/export-detail"
frontHost = "https://web-open.fjmaimaimai.com/#/ability/opportunity/export-detail" //web前端生产环境地址
} else {
frontHost = "http://mmm-web-open-test.fjmaimaimai.com/#/ability/opportunity/export-detail"
frontHost = "http://mmm-web-open-test.fjmaimaimai.com/#/ability/opportunity/export-detail" //web前端测试环境
}
soureData[i]["media"] = fmt.Sprintf("%s?chance_id=%v&check_sum=%s", frontHost, soureData[i]["id"], signString)
... ...