Commit 5f14b939 by liulongfei

底飞开发准备

parent 0fd7b8bf
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<insert index="0">
<element name="1011" description="12345678" complete="false" layer="[MAIN]" showautodescription="true">
<entry name="viz">
<entry name="front">
<entry name="scene">TITLES/2022/YC/YC_FeiGun_text</entry>
</entry>
</entry>
<ref name="master_template">/storage/shows/{ABCB973C-3A85-4DC2-BF2B-2C01BD1433E7}/mastertemplates/YC_FeiGun_text</ref>
<entry name="default_alternatives"></entry>
<schema>
<field name="1" type="richtext" description="FZZongYi-M05S-Regular" singleline="True" location="1/1"/>
<field name="scroll_data.space_before" type="float"/>
<field name="scroll_data.space_after" type="float"/>
</schema>
<entry name="data">
<entry name="1" >12345678</entry>
<entry name="scroll_data.space_before" >0</entry>
<entry name="scroll_data.space_after" >0</entry>
</entry>
<entry name="dblink">
<entry name="1"/>
</entry>
<entry name="settings">
<entry name="tabfields">
<entry name="1"/>
<entry name="scroll_data">
<entry name="type">scroll_data</entry>
</entry>
</entry>
<entry name="isfilescript">false</entry>
<entry name="modified">2023-03-13T16:54:12</entry>
</entry>
<entry name="payload_xml" usage="updating">&lt;payload xmlns=&quot;http://www.vizrt.com/types&quot;&gt;&lt;field name=&quot;1&quot;&gt;&lt;value&gt;12345678&lt;/value&gt;&lt;/field&gt;&lt;/payload&gt;</entry>
</element>
</insert>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<update>
<element name="1011" description="12345678" complete="true" showautodescription="true" scene="TITLES/2022/YC/YC_FeiGun_text">
<entry name="viz">
<entry name="location"></entry>
<entry name="front">
<entry name="scene" timestamp="">TITLES/2022/YC/YC_FeiGun_text</entry>
</entry>
<entry name="load">scene</entry>
<entry name="viz_layer"></entry>
<entry name="use_all_directors">yes</entry>
<entry name="fonts"></entry>
</entry>
<ref name="master_template">/storage/shows/{ABCB973C-3A85-4DC2-BF2B-2C01BD1433E7}/mastertemplates/YC_FeiGun_text</ref>
<entry name="default_alternatives"></entry>
<schema>
<field name="1" type="richtext" description="FZZongYi-M05S-Regular" singleline="True" location="1/1"/>
<field name="scroll_data.space_before" type="float"/>
<field name="scroll_data.space_after" type="float"/>
</schema>
<entry name="data">
<entry name="1" >12345678</entry>
<entry name="scroll_data.space_before" >0</entry>
<entry name="scroll_data.space_after" >0</entry>
</entry>
<entry name="dblink">
<entry name="1"/>
</entry>
<entry name="settings">
<entry name="tabfields">
<entry name="1"/>
<entry name="scroll_data">
<entry name="type">scroll_data</entry>
</entry>
</entry>
<entry name="isfilescript">false</entry>
<entry name="modified">2023-03-13T16:54:12</entry>
</entry>
</element>
</update>
\ No newline at end of file
<UserControl x:Class="VIZ.Package.Module.ScrollElementsEditPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:storage="clr-namespace:VIZ.Package.Storage;assembly=VIZ.Package.Storage"
xmlns:resource="clr-namespace:VIZ.Package.Module.Resource;assembly=VIZ.Package.Module.Resource"
xmlns:local="clr-namespace:VIZ.Package.Module"
d:DataContext="{d:DesignInstance Type=local:ScrollElementsEditPanelModel}"
d:Background="White"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="800">
<UserControl.Resources>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
</UserControl.Resources>
<Grid VerticalAlignment="Stretch" AllowDrop="True">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<!-- 模板 -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="300"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="底飞模板:" VerticalAlignment="Center" HorizontalAlignment="Right" Opacity="0.86"></TextBlock>
<dxe:ComboBoxEdit IsTextEditable="False" Height="30" Grid.Column="1" Margin="20,0,0,0"
EditValue="{Binding Path=SelectedSceneTemplateModel,Mode=TwoWay}"
ItemsSource="{Binding Path=SceneTemplateModels,Mode=OneWay}" DisplayMember="Scene"></dxe:ComboBoxEdit>
<StackPanel Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="40,0,0,0">
<Button Width="120" Height="30" Content="应用模板" Command="{Binding Path=ApplyTemplateCommand}"></Button>
</StackPanel>
</Grid>
<!-- 数据 -->
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// ScrollElementsEditPanel.xaml 的交互逻辑
/// </summary>
public partial class ScrollElementsEditPanel : UserControl
{
public ScrollElementsEditPanel()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new ScrollElementsEditPanelModel());
}
}
}
using LiteDB.Engine;
using log4net;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
namespace VIZ.Package.Module
{
/// <summary>
/// ScrollElements类型编辑面板模型
/// </summary>
public class ScrollElementsEditPanelModel : EditPanelModelBase
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(ScrollElementsEditPanelModel));
public ScrollElementsEditPanelModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.ApplyTemplateCommand = new VCommand(this.ApplyTemplate);
}
// ============================================================
// Property
// ============================================================
#region EditValue -- 编辑值
private string editValue;
/// <summary>
/// 编辑值
/// </summary>
public string EditValue
{
get { return editValue; }
set
{
editValue = value;
this.RaisePropertyChanged(nameof(EditValue));
this.OnEditValueChanged();
}
}
#endregion
#region SceneTemplateModels -- 场景模板集合
private ObservableCollection<PageTemplateModel> sceneTemplateModels;
/// <summary>
/// 场景模板集合
/// </summary>
public ObservableCollection<PageTemplateModel> SceneTemplateModels
{
get { return sceneTemplateModels; }
set { sceneTemplateModels = value; this.RaisePropertyChanged(nameof(SceneTemplateModels)); }
}
#endregion
#region SelectedSceneTemplateModel -- 当前选中的场景模板
private PageTemplateModel selectedSceneTemplateModel;
/// <summary>
/// 当前选中的场景模板
/// </summary>
public PageTemplateModel SelectedSceneTemplateModel
{
get { return selectedSceneTemplateModel; }
set { selectedSceneTemplateModel = value; this.RaisePropertyChanged(nameof(SelectedSceneTemplateModel)); }
}
#endregion
// ============================================================
// Command
// ============================================================
#region ApplyTemplateCommand -- 应用模板命令
/// <summary>
/// 应用模板命令
/// </summary>
public VCommand ApplyTemplateCommand { get; set; }
/// <summary>
/// 应用模板
/// </summary>
private void ApplyTemplate()
{
if (this.SelectedSceneTemplateModel == null)
return;
PageModelBase pageBase = ApplicationDomainEx.CurrentPage;
if (pageBase == null)
return;
}
#endregion
// ============================================================
// Message
// ============================================================
// ============================================================
// Public Function
// ============================================================
/// <summary>
/// 更新
/// </summary>
/// <param name="controlObject">控制对象</param>
/// <param name="controlField">控制字段</param>
public override void Update(ControlObjectModel controlObject, ControlFieldNodeModel controlField)
{
base.Update(controlObject, controlField);
this.IsSendToPreview = false;
IPageTemplateService service = ApplicationDomainEx.ServiceManager.GetService<IPageTemplateService>(ViewServiceKeys.PAGE_TEMPLATE_SERVICE);
this.SceneTemplateModels = service.SceneTemplateModels.Where(p => p.TransitionLogic && p.ScenePath != ApplicationDomainEx.CurrentPage?.ScenePath).ToObservableCollection();
this.SelectedSceneTemplateModel = null;
this.EditValue = controlField?.Value?.ToString();
this.IsSendToPreview = true;
}
/// <summary>
/// 更新动态数据
/// </summary>
/// <param name="listCellEdit">列单元格编辑器</param>
/// <param name="columnDefinition">列定义</param>
/// <param name="rowHandle">行号</param>
/// <param name="row">行数据</param>
public override void UpdateDynamic(ListCellEditBase listCellEdit, GridColumnControlFieldDefinition columnDefinition, int rowHandle, ExpandoObject row)
{
base.UpdateDynamic(listCellEdit, columnDefinition, rowHandle, row);
IDictionary<string, object> dic = row as IDictionary<string, object>;
this.IsSendToPreview = false;
this.EditValue = dic?[columnDefinition.FieldName]?.ToString();
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.EditValue;
}
// ============================================================
// Private Function
// ============================================================
/// <summary>
/// 值改变时触发
/// </summary>
private void OnEditValueChanged()
{
// 不需要向预览发送值
if (!this.IsSendToPreview)
return;
// 没有预览连接
if (ApplicationDomainEx.PreviewConn == null)
return;
// 没有控制对象或控制字段
if (this.ControlObject == null || this.ControlField == null)
return;
// 正常模式编辑
if (this.FieldEditMode == FieldEditMode.Normal)
{
this.ControlField.Value = this.EditValue;
if (!this.ControlField.IsCustom)
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
}
else
{
this.VizCommandControlObjectService.SetCustomControlFieldValue(ApplicationDomainEx.PreviewConn, new List<ControlFieldNodeModel> { this.ControlField });
}
return;
}
// 没有列信息或行数据
if (this.ColumnDefinition == null || this.Row == null)
return;
// 动态模式编辑
if (this.FieldEditMode == FieldEditMode.Dynamic)
{
IDictionary<string, object> dic = this.Row as IDictionary<string, object>;
dic[this.ColumnDefinition.FieldName] = this.EditValue;
this.ListCellEdit.UpdateEditValue(this.ColumnDefinition, this.RowHandle, this.Row);
return;
}
}
}
}
......@@ -119,6 +119,14 @@ namespace VIZ.Package.Module
ViewCreated = this.OnViewCreated
});
// 底飞
this.NavigationConfigs.Add(new NavigationConfig
{
Key = VizControlFieldType.scroll_elements.ToString(),
ViewType = typeof(ScrollElementsEditPanel),
ViewCreated = this.OnViewCreated
});
// 自定义视频
this.NavigationConfigs.Add(new NavigationConfig
{
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -14,6 +15,11 @@ namespace VIZ.Package.Module
public interface IPageTemplateService : IService
{
/// <summary>
/// 场景模板集合
/// </summary>
ObservableCollection<PageTemplateModel> SceneTemplateModels { get; }
/// <summary>
/// 添加场景模板
/// </summary>
/// <param name="fileModels">文件模型集合</param>
......
......@@ -18,7 +18,6 @@ using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace VIZ.Package.Module
{
......
......@@ -24,7 +24,7 @@
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid>
<Grid Background="#FF222222">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
......@@ -109,7 +109,7 @@
</StackPanel>
</Grid>
<!-- VIZ引擎 -->
<fcommon:WindowHost x:Name="host" Grid.Row="1" Background="#FF222222" BackColor="#FF222222">
<fcommon:WindowHost x:Name="host" Grid.Row="1" Background="#FF222222" BackColor="#FF222222" Margin="0,0,3,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand PassEventArgsToCommand="True" EventName="SizeChanged"
Command="{Binding Path=WindowHostSizeChangedCommand}"></dxmvvm:EventToCommand>
......
......@@ -115,6 +115,10 @@
<Compile Include="ControlObject\FieldEdit\Edit\ListEdit\CellEdit\FontListCellEdit.xaml.cs">
<DependentUpon>FontListCellEdit.xaml</DependentUpon>
</Compile>
<Compile Include="ControlObject\FieldEdit\Edit\ScrollElementsEdit\ScrollElementsEditPanel.xaml.cs">
<DependentUpon>ScrollElementsEditPanel.xaml</DependentUpon>
</Compile>
<Compile Include="ControlObject\FieldEdit\Edit\ScrollElementsEdit\ScrollElementsEditPanelModel.cs" />
<Compile Include="Control\Controller\ControlController.cs" />
<Compile Include="Control\Service\IControlService.cs" />
<Compile Include="Help\About\ViewModel\AboutCustomControlFieldWindowModel.cs" />
......@@ -442,6 +446,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ControlObject\FieldEdit\Edit\ScrollElementsEdit\ScrollElementsEditPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Help\About\View\AboutCustomControlFieldWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
......@@ -539,6 +539,9 @@ namespace VIZ.Package.Service
if (type == "radio")
return VizControlFieldType.radio;
if (type == "scroll_elements")
return VizControlFieldType.scroll_elements;
if (type.StartsWith("<?xml"))
return VizControlFieldType.list;
......
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 底飞字段值
/// </summary>
public class ScrollElementFieldValue
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 模板ID或者页ID
/// </summary>
public Guid TemplateOrPageID { get; set; }
/// <summary>
/// 元素编号
/// </summary>
public string ElementNum { get; set; }
/// <summary>
/// 字段名称
/// </summary>
public string FieldIdentifier { get; set; }
/// <summary>
/// 字段值
/// </summary>
public string Value { get; set; }
}
}
......@@ -39,8 +39,9 @@ namespace VIZ.Package.Storage
this.Page = this.Database.GetCollection<PageEntity>();
this.ControlField = this.Database.GetCollection<ControlFieldEntity>();
this.ControlObject = this.Database.GetCollection<ControlObjectEntity>();
this.SceneThumbnailCache = this.Database.GetStorage<Guid>("_SceneThumbnailFiles", "_SceneThumbnailChunks");
this.ScrollElementTemplateControlField = this.Database.GetCollection<ControlFieldEntity>("ScrollElementTemplate");
this.ScrollElementFieldValue = this.Database.GetCollection<ScrollElementFieldValue>();
}
/// <summary>
......@@ -79,6 +80,16 @@ namespace VIZ.Package.Storage
public ILiteStorage<Guid> SceneThumbnailCache { get; private set; }
/// <summary>
/// 底飞模板字段
/// </summary>
public ILiteCollection<ControlFieldEntity> ScrollElementTemplateControlField { get; private set; }
/// <summary>
/// 底飞字段值
/// </summary>
public ILiteCollection<ScrollElementFieldValue> ScrollElementFieldValue { get; private set; }
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
......@@ -86,6 +97,11 @@ namespace VIZ.Package.Storage
this.PageTemplate = null;
this.PageGroup = null;
this.Page = null;
this.ControlField = null;
this.ControlObject = null;
this.SceneThumbnailCache = null;
this.ScrollElementTemplateControlField = null;
this.ScrollElementFieldValue = null;
this.Database?.Dispose();
}
......
......@@ -107,6 +107,7 @@
<Compile Include="Entity\Page\PageGroupEntity.cs" />
<Compile Include="Entity\Page\PageTemplateEntity.cs" />
<Compile Include="Entity\Config\VizConfigEntity.cs" />
<Compile Include="Entity\ScrollElement\ScrollElementFieldValue.cs" />
<Compile Include="Enum\EngineFullType.cs" />
<Compile Include="Enum\EngineType.cs" />
<Compile Include="Enum\PageType.cs" />
......
......@@ -5,6 +5,8 @@ VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Doc", "00-Doc", "{4F55B183-4696-461C-8284-040FA7472C39}"
ProjectSection(SolutionItems) = preProject
Doc\底飞_insert.xml = Doc\底飞_insert.xml
Doc\底飞_update.xml = Doc\底飞_update.xml
Doc\控制对象自定义字段.txt = Doc\控制对象自定义字段.txt
EndProjectSection
EndProject
......
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