Beispiel #1
0
        /// <summary>
        /// 获取标签生成器
        /// </summary>
        protected override TagBuilder GetTagBuilder()
        {
            var builder = new FormLabelBuilder();

            Config(builder);
            return(builder);
        }
Beispiel #2
0
        /// <summary>
        /// 获取标签生成器
        /// </summary>
        protected override TagBuilder GetTagBuilder()
        {
            ResolveExpression();
            var builder = new FormLabelBuilder();

            Config(builder);
            return(builder);
        }
Beispiel #3
0
        /// <summary>
        /// 创建表单标签生成器
        /// </summary>
        /// <param name="config">配置</param>
        public static FormLabelBuilder CreateFormLabelBuilder(Config config)
        {
            var result = new FormLabelBuilder();

            result.AppendContent(GetLabel(config));
            result.AddRequired(config.GetBoolValue(UiConst.Required));
            result.AddSpan(GridHelper.GetLabelSpan(config));
            return(result);
        }
Beispiel #4
0
 /// <summary>
 /// 配置
 /// </summary>
 private void Config(FormLabelBuilder builder)
 {
     ConfigId(builder);
     ConfigText(builder);
     ConfigRequired(builder);
     ConfigFor(builder);
     ConfigColon(builder);
     ConfigGrid(builder);
     ConfigContent(builder);
 }
Beispiel #5
0
        /// <summary>
        /// 配置跨度
        /// </summary>
        private void ConfigSpan(FormLabelBuilder builder)
        {
            var result = _config.GetValue(UiConst.Span);

            if (result.IsEmpty())
            {
                var shareConfig = GridHelper.GetShareConfig(_config);
                result = shareConfig?.LabelSpan;
            }
            builder.AddSpan(result);
        }
Beispiel #6
0
 /// <summary>
 /// 配置必填样式
 /// </summary>
 private void ConfigRequired(FormLabelBuilder builder)
 {
     builder.AddRequired(_config.GetBoolValue(UiConst.Required));
 }
Beispiel #7
0
 /// <summary>
 /// 配置文本
 /// </summary>
 private void ConfigText(FormLabelBuilder builder)
 {
     builder.AppendContent(_config.GetValue(UiConst.Label));
 }
Beispiel #8
0
 /// <summary>
 /// 配置栅格
 /// </summary>
 private void ConfigGrid(FormLabelBuilder builder)
 {
     ConfigSpan(builder);
 }