Commit d4332e98 authored by 黄奎's avatar 黄奎

页面修改

parent a647ee09
......@@ -59,6 +59,16 @@ namespace Mall.Model.Extend.TradePavilion
/// 是否必填
/// </summary>
public bool IsRequire { get; set; }
/// <summary>
/// 文本值
/// </summary>
public string TextValue { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
/// <summary>
......@@ -85,6 +95,32 @@ namespace Mall.Model.Extend.TradePavilion
/// 是否必填
/// </summary>
public bool IsRequire { get; set; }
/// <summary>
/// 选项列表
/// </summary>
public List<SelectOption> OptionList { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
/// <summary>
/// 选项列表
/// </summary>
public class SelectOption
{
/// <summary>
/// 编号
/// </summary>
public string Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
/// <summary>
......@@ -106,6 +142,16 @@ namespace Mall.Model.Extend.TradePavilion
/// 上传文件大小M
/// </summary>
public int FileSizeLimit { get; set; }
/// <summary>
/// 上传文件列表
/// </summary>
public List<string> FileList { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}
......@@ -104,7 +104,7 @@ namespace Mall.Module.TradePavilion
var extModel = custom_FormRepository.GetEntity<RB_Custom_Form_Extend>(Id);
if (extModel != null)
{
extModel.FormDataList = AnalyzeFormComponent(extModel.FormData);
extModel.FormDataList = AnalyzeFormComponent(extModel.FormData, isGetAnswer: true);
}
return extModel;
}
......@@ -113,13 +113,13 @@ namespace Mall.Module.TradePavilion
/// 解析表单组件
/// </summary>
/// <param name="formData"></param>
/// <param name="isGetAnswer"></param>
/// <returns></returns>
public List<FormDataItem> AnalyzeFormComponent(string formData)
public List<FormDataItem> AnalyzeFormComponent(string formData,bool isGetAnswer=false)
{
List<FormDataItem> dataList = new List<FormDataItem>();
if (!string.IsNullOrEmpty(formData))
{
JArray jArray = JArray.Parse(formData);
if (jArray != null && jArray.Count > 0)
{
......@@ -144,6 +144,8 @@ namespace Mall.Module.TradePavilion
Name = singleObj.GetStringValue("Name"),
WordsLength = singleObj.GetInt("WordsLength"),
IsRequire = singleObj.GetBoolValue("IsRequire"),
Remark = singleObj.GetStringValue("Remark"),
TextValue = isGetAnswer ? singleObj.GetStringValue("TextValue") : "",
};
dataItem.CompData = txtItem;
break;
......@@ -155,6 +157,8 @@ namespace Mall.Module.TradePavilion
Name = multiObj.GetStringValue("Name"),
WordsLength = multiObj.GetInt("WordsLength"),
IsRequire = multiObj.GetBoolValue("IsRequire"),
Remark = multiObj.GetStringValue("Remark"),
TextValue = isGetAnswer ? multiObj.GetStringValue("TextValue") : "",
};
dataItem.CompData = multiItem;
break;
......@@ -166,8 +170,24 @@ namespace Mall.Module.TradePavilion
Name = dropdownObj.GetStringValue("Name"),
IsMultiple = dropdownObj.GetBoolValue("IsMultiple"),
IsRequire = dropdownObj.GetBoolValue("IsRequire"),
OptionValue = "",
OptionValue = isGetAnswer ? dropdownObj.GetStringValue("OptionValue") : "",
OptionList = new List<SelectOption>(),
Remark=dropdownObj.GetStringValue("Remark"),
};
var optionList = JArray.Parse(dropdownObj.GetStringValue("OptionList"));
if (optionList != null && optionList.Count > 0)
{
foreach (var oItem in optionList)
{
JObject optionObj = JObject.Parse(oItem.ToString());
SelectOption option = new SelectOption()
{
Id= optionObj.GetStringValue("Id"),
Name= optionObj.GetStringValue("Name"),
};
selectItem.OptionList.Add(option);
}
}
dataItem.CompData = selectItem;
break;
//图片上传组件
......@@ -178,7 +198,24 @@ namespace Mall.Module.TradePavilion
Name = imgObj.GetStringValue("Name"),
FileCount = imgObj.GetInt("FileCount"),
FileSizeLimit = imgObj.GetInt("FileSizeLimit"),
Remark = imgObj.GetStringValue("Remark"),
FileList = new List<string>(),
};
if (!string.IsNullOrEmpty(imgObj.GetStringValue("FileList")))
{
try
{
imgItem.FileList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(imgObj.GetStringValue("FileList"));
}
catch
{
}
}
if (!isGetAnswer)
{
imgItem.FileList = new List<string>();
}
dataItem.CompData = imgItem;
break;
//视频上传组件
......@@ -189,7 +226,21 @@ namespace Mall.Module.TradePavilion
Name = videoObj.GetStringValue("Name"),
FileCount = videoObj.GetInt("FileCount"),
FileSizeLimit = videoObj.GetInt("FileSizeLimit"),
Remark=videoObj.GetStringValue("Remark"),
FileList = new List<string>(),
};
try
{
videoItem.FileList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(videoObj.GetStringValue("FileList"));
}
catch
{
}
if (!isGetAnswer)
{
videoItem.FileList = new List<string>();
}
dataItem.CompData = videoItem;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment