Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
e63ff74b
Commit
e63ff74b
authored
Feb 22, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复字段保存与另存为bug
parent
561def36
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
5 deletions
+34
-5
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/CellEdit/IntegerListCellEdit.xaml.cs
+1
-1
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
+21
-2
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+2
-2
VIZ.Package.Service/DB/ControlObject/ControlObjectService.cs
+10
-0
No files found.
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/CellEdit/IntegerListCellEdit.xaml.cs
View file @
e63ff74b
...
...
@@ -36,7 +36,7 @@ namespace VIZ.Package.Module
DevExpress
.
Xpf
.
Grid
.
EditGridCellData
cellData
=
e
.
NewValue
as
DevExpress
.
Xpf
.
Grid
.
EditGridCellData
;
this
.
IsSendToPreview
=
false
;
bool
.
TryParse
(
cellData
?.
Value
?.
ToString
(),
out
bool
value
);
int
.
TryParse
(
cellData
?.
Value
?.
ToString
(),
out
int
value
);
this
.
PART_Text
.
EditValue
=
value
;
this
.
IsSendToPreview
=
true
;
}
...
...
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
View file @
e63ff74b
...
...
@@ -162,6 +162,8 @@ namespace VIZ.Package.Module
return
;
}
// 更新列表值
service
.
TryUpdateControlFieldListValue
();
// 保存
this
.
controlObjectService
.
SaveControlFields
(
ApplicationDomainEx
.
CurrentPage
,
obj
.
AllFiledNodes
);
}
...
...
@@ -195,18 +197,35 @@ namespace VIZ.Package.Module
return
;
}
// 更新列表值
IFieldTreeService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
if
(
service
==
null
)
{
DXMessageBox
.
Show
(
"另存失败!"
);
return
;
}
service
.
TryUpdateControlFieldListValue
();
// 获取当前打开页的控制对象
ControlObjectModel
controlObject
=
service
.
GetControlObject
();
if
(
controlObject
==
null
)
{
DXMessageBox
.
Show
(
"另存失败!"
);
return
;
}
// 另存模板
if
(
ApplicationDomainEx
.
CurrentPage
is
PageTemplateModel
srcTemplate
)
{
PageModel
page
=
pageGroupService
.
AddPage
(
srcTemplate
);
this
.
controlObjectService
.
CopyControlFields
(
srcTemplate
.
TemplateID
,
page
.
PageID
);
this
.
controlObjectService
.
SaveControlFields
(
page
.
PageID
,
controlObject
.
AllFiledNodes
);
pageGroupService
.
OpenPage
(
page
);
}
// 另存页
else
if
(
ApplicationDomainEx
.
CurrentPage
is
PageModel
srcPage
)
{
PageModel
page
=
pageGroupService
.
CopyPage
();
this
.
controlObjectService
.
CopyControlFields
(
srcPage
.
PageID
,
page
.
PageID
);
this
.
controlObjectService
.
SaveControlFields
(
page
.
PageID
,
controlObject
.
AllFiledNodes
);
pageGroupService
.
OpenPage
(
page
);
}
}
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
e63ff74b
...
...
@@ -364,14 +364,14 @@ namespace VIZ.Package.Module
if
(
this
.
SelectedPageGroupModel
==
null
)
return
;
if
(
this
.
SelectedPageGroupModel
.
SelectedPages
==
null
||
this
.
SelectedPageGroupModel
.
Pages
.
Count
==
0
)
if
(
this
.
SelectedPageGroupModel
.
SelectedPages
==
null
||
this
.
SelectedPageGroupModel
.
Selected
Pages
.
Count
==
0
)
return
;
string
pageNums
=
string
.
Join
(
" ,"
,
this
.
SelectedPageGroupModel
.
SelectedPages
.
Select
(
p
=>
p
.
GetPageNumString
()));
if
(
DXMessageBox
.
Show
(
$"是否删除页 [
{
pageNums
}
] ?"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
return
;
List
<
PageModel
>
pages
=
this
.
SelectedPageGroupModel
.
Pages
.
ToList
();
List
<
PageModel
>
pages
=
this
.
SelectedPageGroupModel
.
Selected
Pages
.
ToList
();
foreach
(
PageModel
page
in
pages
)
{
...
...
VIZ.Package.Service/DB/ControlObject/ControlObjectService.cs
View file @
e63ff74b
...
...
@@ -23,6 +23,16 @@ namespace VIZ.Package.Service
{
Guid
id
=
this
.
GetTemplateIdOrPageId
(
pageBase
);
this
.
SaveControlFields
(
id
,
fields
);
}
/// <summary>
/// 保存控制字段
/// </summary>
/// <param name="id">页或模板ID</param>
/// <param name="fields">控制字段</param>
public
void
SaveControlFields
(
Guid
id
,
IList
<
ControlFieldNodeModel
>
fields
)
{
ApplicationDomainEx
.
ProjectDbContext
.
ControlField
.
DeleteMany
(
p
=>
p
.
PageID
==
id
);
List
<
ControlFieldEntity
>
list
=
new
List
<
ControlFieldEntity
>();
...
...
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