Commit a166200f by liulongfei

ziduan bianji

parent c2825942
......@@ -37,6 +37,11 @@ namespace VIZ.Package.Domain
public const string FIELD_TREE_SERVICE = "FIELD_TREE_SERVICE";
/// <summary>
/// 字段编辑服务
/// </summary>
public const string FIELD_EDIT_SERVICE = "FIELD_EDIT_SERVICE";
/// <summary>
/// 插件服务
/// </summary>
public const string PLUGIN_SERVICE = "PLUGIN_SERVICE";
......
......@@ -89,6 +89,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.EditValue ? "1" : "0";
}
// ============================================================
// Private Function
// ============================================================
......
......@@ -201,6 +201,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.Text;
}
// ============================================================
// Private Function
// ============================================================
......
......@@ -174,5 +174,11 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public abstract string GetFieldValue();
}
}
......@@ -130,6 +130,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.Path;
}
// =====================================================================
// Private Function
// =====================================================================
......
......@@ -76,6 +76,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.EditValue.ToString();
}
// ============================================================
// Private Function
// ============================================================
......
......@@ -81,5 +81,14 @@ namespace VIZ.Package.Module
this.Columns = columns;
this.ItemsSource = items;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.vizCommandControlObjectService.GetControlObjectXml(this.ItemsSource);
}
}
}
......@@ -88,6 +88,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.Text;
}
// ============================================================
// Private Function
// ============================================================
......
......@@ -78,6 +78,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.Text;
}
// ============================================================
// Private Function
// ============================================================
......
......@@ -227,6 +227,15 @@ namespace VIZ.Package.Module
this.IsSendToPreview = true;
}
/// <summary>
/// 获取字段值
/// </summary>
/// <returns>字段值</returns>
public override string GetFieldValue()
{
return this.Text;
}
// ============================================================
// Private Function
// ============================================================
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// 字段编辑服务
/// </summary>
public interface IFieldEditService : IService
{
/// <summary>
/// 获取当前正在编辑字段的值
/// </summary>
/// <returns>当前正在编辑字段的值</returns>
string GetCurrentEditFieldValue();
}
}
......@@ -14,7 +14,7 @@ namespace VIZ.Package.Module
/// <summary>
/// 字段编辑视图模型
/// </summary>
public class FieldEditViewModel : ViewModelBase
public class FieldEditViewModel : ViewModelBase, IFieldEditService
{
public FieldEditViewModel()
{
......@@ -23,6 +23,9 @@ namespace VIZ.Package.Module
// 初始化消息
this.InitMessage();
// 注册服务
ApplicationDomainEx.ServiceManager.AddService(ViewServiceKeys.FIELD_EDIT_SERVICE, this);
}
/// <summary>
......@@ -201,6 +204,31 @@ namespace VIZ.Package.Module
}
// =============================================================
// Public Function
// =============================================================
/// <summary>
/// 获取当前正在编辑字段的值
/// </summary>
/// <returns>当前正在编辑字段的值</returns>
public string GetCurrentEditFieldValue()
{
if (this.SelectedNavigationConfig == null || this.SelectedNavigationConfig.View == null)
return null;
this.SelectedNavigationConfig.View.TryGetTarget(out object target);
FrameworkElement view = target as FrameworkElement;
if (view == null)
return null;
EditPanelModelBase vm = view.DataContext as EditPanelModelBase;
if (vm == null)
return null;
return vm.GetFieldValue();
}
// =============================================================
// Private Function
// =============================================================
......
......@@ -96,6 +96,9 @@ namespace VIZ.Package.Module
get { return selectedControlField; }
set
{
// 字段改变处理
this.beforeControlFieldChanged(selectedControlField, value);
selectedControlField = value;
this.RaisePropertyChanged(nameof(SelectedControlField));
......@@ -165,5 +168,24 @@ namespace VIZ.Package.Module
{
return this.ControlObject;
}
// =============================================================
// Private Function
// =============================================================
/// <summary>
/// 控制字段改变之前触发
/// </summary>
/// <param name="oldField">改变之前的字段</param>
/// <param name="newField">改变之后的字段</param>
private void beforeControlFieldChanged(ControlFieldNodeModel oldField, ControlFieldNodeModel newField)
{
// 如果之前的字段为list字段,那么需要更新最新的list值
if (oldField != null && oldField.Type == Storage.VizControlFieldType.list)
{
IFieldEditService service = ApplicationDomainEx.ServiceManager.GetService<IFieldEditService>(ViewServiceKeys.FIELD_EDIT_SERVICE);
}
}
}
}
\ No newline at end of file
......@@ -90,6 +90,7 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="ControlObject\FieldEdit\Service\IFieldEditService.cs" />
<Compile Include="ControlObject\FieldTree\Service\IFieldTreeService.cs" />
<Compile Include="Main\ViewModel\MainConnViewModel.cs" />
<Compile Include="Main\View\MainConnView.xaml.cs">
......
......@@ -19,6 +19,9 @@ namespace VIZ.Package.Service
/// <summary>
/// 不启用编辑类型
/// </summary>
/// <remarks>
/// 不启用编辑则可以直接在GridControl的单元格中直径进行值修改
/// </remarks>
private static readonly List<VizControlFieldType> ALLOW_EDITING_FALSE_TYPES = new List<VizControlFieldType>
{
VizControlFieldType.none,
......
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