Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
28444f32
Commit
28444f32
authored
Aug 31, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
697b674c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
76 deletions
+104
-76
CustomFormTypeEnum.cs
Mall.Common/Enum/TradePavilion/CustomFormTypeEnum.cs
+6
-0
CustomFormModule.cs
Mall.Module.TradePavilion/CustomFormModule.cs
+97
-75
CustomFormController.cs
Mall.WebApi/Controllers/MallBase/CustomFormController.cs
+1
-1
No files found.
Mall.Common/Enum/TradePavilion/CustomFormTypeEnum.cs
View file @
28444f32
...
...
@@ -30,5 +30,11 @@ namespace Mall.Common.Enum.TradePavilion
/// </summary>
[
EnumField
(
"首发"
)]
SF
=
4
,
/// <summary>
/// 品牌
/// </summary>
[
EnumField
(
"品牌"
)]
PingPai
=
5
,
}
}
Mall.Module.TradePavilion/CustomFormModule.cs
View file @
28444f32
...
...
@@ -157,84 +157,39 @@ namespace Mall.Module.TradePavilion
};
if
(!
string
.
IsNullOrEmpty
(
dataItem
.
CompKey
))
{
string
compData
=
jObj
.
GetStringValue
(
"CompData"
);
switch
(
dataItem
.
CompKey
)
{
//单行文本
case
"SingleLineText"
:
JObject
singleObj
=
JObject
.
Parse
(
jObj
.
GetStringValue
(
"CompData"
)
);
TextItem
txtItem
=
new
TextItem
(
)
TextItem
txtItem
=
GetTextItem
(
compData
);
if
(!
isGetAnswer
)
{
Name
=
singleObj
.
GetStringValue
(
"Name"
),
WordsLength
=
singleObj
.
GetInt
(
"WordsLength"
),
IsRequire
=
singleObj
.
GetBoolValue
(
"IsRequire"
),
Remark
=
singleObj
.
GetStringValue
(
"Remark"
),
TextValue
=
isGetAnswer
?
singleObj
.
GetStringValue
(
"TextValue"
)
:
""
,
};
txtItem
.
TextValue
=
""
;
}
dataItem
.
CompData
=
txtItem
;
break
;
//多行文本
case
"MultiLineText"
:
JObject
multiObj
=
JObject
.
Parse
(
jObj
.
GetStringValue
(
"CompData"
)
);
TextItem
multiItem
=
new
TextItem
(
)
TextItem
multiItem
=
GetTextItem
(
compData
);
if
(!
isGetAnswer
)
{
Name
=
multiObj
.
GetStringValue
(
"Name"
),
WordsLength
=
multiObj
.
GetInt
(
"WordsLength"
),
IsRequire
=
multiObj
.
GetBoolValue
(
"IsRequire"
),
Remark
=
multiObj
.
GetStringValue
(
"Remark"
),
TextValue
=
isGetAnswer
?
multiObj
.
GetStringValue
(
"TextValue"
)
:
""
,
};
multiItem
.
TextValue
=
""
;
}
dataItem
.
CompData
=
multiItem
;
break
;
//下拉框
case
"DorpDownList"
:
JObject
dropdownObj
=
JObject
.
Parse
(
jObj
.
GetStringValue
(
"CompData"
));
SelectItem
selectItem
=
new
SelectItem
()
{
Name
=
dropdownObj
.
GetStringValue
(
"Name"
),
IsMultiple
=
dropdownObj
.
GetBoolValue
(
"IsMultiple"
),
IsRequire
=
dropdownObj
.
GetBoolValue
(
"IsRequire"
),
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
)
SelectItem
selectItem
=
GetSelectItem
(
compData
);
if
(!
isGetAnswer
)
{
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
);
}
selectItem
.
OptionValue
=
""
;
}
dataItem
.
CompData
=
selectItem
;
break
;
//图片上传组件
case
"ImageUploadComp"
:
JObject
imgObj
=
JObject
.
Parse
(
jObj
.
GetStringValue
(
"CompData"
));
UploadItem
imgItem
=
new
UploadItem
()
{
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
{
}
}
UploadItem
imgItem
=
GetUploadItem
(
compData
);
if
(!
isGetAnswer
)
{
imgItem
.
FileList
=
new
List
<
string
>();
...
...
@@ -243,23 +198,7 @@ namespace Mall.Module.TradePavilion
break
;
//视频上传组件
case
"VideoUploadComp"
:
JObject
videoObj
=
JObject
.
Parse
(
jObj
.
GetStringValue
(
"CompData"
));
UploadItem
videoItem
=
new
UploadItem
()
{
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
{
}
UploadItem
videoItem
=
GetUploadItem
(
compData
);
if
(!
isGetAnswer
)
{
videoItem
.
FileList
=
new
List
<
string
>();
...
...
@@ -275,6 +214,89 @@ namespace Mall.Module.TradePavilion
return
dataList
;
}
/// <summary>
/// 获取文本框信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
TextItem
GetTextItem
(
string
CompData
)
{
JObject
textObj
=
JObject
.
Parse
(
CompData
);
TextItem
txtItem
=
new
TextItem
()
{
Name
=
textObj
.
GetStringValue
(
"Name"
),
WordsLength
=
textObj
.
GetInt
(
"WordsLength"
),
IsRequire
=
textObj
.
GetBoolValue
(
"IsRequire"
),
Remark
=
textObj
.
GetStringValue
(
"Remark"
),
TextValue
=
textObj
.
GetStringValue
(
"TextValue"
),
};
return
txtItem
;
}
/// <summary>
/// 获取下拉框信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
SelectItem
GetSelectItem
(
string
CompData
)
{
JObject
dropdownObj
=
JObject
.
Parse
(
CompData
);
SelectItem
selectItem
=
new
SelectItem
()
{
Name
=
dropdownObj
.
GetStringValue
(
"Name"
),
IsMultiple
=
dropdownObj
.
GetBoolValue
(
"IsMultiple"
),
IsRequire
=
dropdownObj
.
GetBoolValue
(
"IsRequire"
),
OptionValue
=
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
);
}
}
return
selectItem
;
}
/// <summary>
/// 获取上传配置信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
UploadItem
GetUploadItem
(
string
CompData
)
{
JObject
uploadObj
=
JObject
.
Parse
(
CompData
);
UploadItem
uploadItem
=
new
UploadItem
()
{
Name
=
uploadObj
.
GetStringValue
(
"Name"
),
FileCount
=
uploadObj
.
GetInt
(
"FileCount"
),
FileSizeLimit
=
uploadObj
.
GetInt
(
"FileSizeLimit"
),
Remark
=
uploadObj
.
GetStringValue
(
"Remark"
),
FileList
=
new
List
<
string
>(),
};
if
(!
string
.
IsNullOrEmpty
(
uploadObj
.
GetStringValue
(
"FileList"
)))
{
try
{
uploadItem
.
FileList
=
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
uploadObj
.
GetStringValue
(
"FileList"
));
}
catch
{
}
}
return
uploadItem
;
}
/// <summary>
/// 根据编号删除自定义表单
...
...
Mall.WebApi/Controllers/MallBase/CustomFormController.cs
View file @
28444f32
...
...
@@ -89,7 +89,7 @@ namespace Mall.WebApi.Controllers.MallBase
FormType
=
(
Common
.
Enum
.
TradePavilion
.
CustomFormTypeEnum
)
parms
.
GetInt
(
"FormType"
)
};
var
formData
=
parms
.
GetStringValue
(
"FormData"
);
List
<
FormDataItem
>
dataList
=
customFormModule
.
AnalyzeFormComponent
(
formData
);
List
<
FormDataItem
>
dataList
=
customFormModule
.
AnalyzeFormComponent
(
formData
,
isGetAnswer
:
true
);
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
model
.
FormData
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
dataList
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment