Commit 567438b2 by jianshuqin

优化:组件功能

parent e4fb2e5e
......@@ -52,22 +52,22 @@ namespace Bailun.DC.Models.Component.Entity
/// <summary>
/// 是否显示查询按钮:(默认是)
/// </summary>
public bool? is_show_search_button { get; set; }
public bool is_show_search_button { get; set; }
/// <summary>
/// 是否显示重置按钮:(默认是)
/// </summary>
public bool? is_show_reset_button { get; set; }
public bool is_show_reset_button { get; set; }
/// <summary>
/// 是否显示导出按钮:(默认否)
/// </summary>
public bool? is_show_export_button { get; set; }
public bool is_show_export_button { get; set; }
/// <summary>
/// 是否显示导入按钮:(默认否)
/// </summary>
public bool? is_show_import_button { get; set; }
public bool is_show_import_button { get; set; }
/// <summary>
/// 操作控件
......@@ -82,7 +82,7 @@ namespace Bailun.DC.Models.Component.Entity
/// <summary>
/// 是否显示顺序列:(默认否)
/// </summary>
public bool? is_show_sequence_column { get; set; }
public bool is_show_sequence_column { get; set; }
/// <summary>
/// 选择行方式:1: 单选, 2: 多选
......@@ -102,7 +102,7 @@ namespace Bailun.DC.Models.Component.Entity
/// <summary>
/// 是否显示列查询:(默认否)
/// </summary>
public bool? is_show_column_search { get; set; }
public bool is_show_column_search { get; set; }
/// <summary>
/// 操作列名
......
......@@ -190,9 +190,9 @@ namespace Bailun.DC.Services.Component
{
result.Message = "名称不能为空";
}
else if (string.IsNullOrWhiteSpace(dto.Name))
else if (DB.QueryFirstOrDefault<int>($"select count(id) from dc_component_form where code = @code {(dto.Id > 0 ? "and id <> @id" : string.Empty)}", new { id = dto.Id, code = dto.Code }) > 0)
{
result.Message = "名称不能为空";
result.Message = "编码重复";
}
else
{
......
......@@ -534,12 +534,12 @@ namespace Bailun.DC.Services.Component
name = dto.Name,
menu_code = dto.MenuCode,
javascript = dto.Javascript,
is_show_search_button = dto.IsShowSearchButton,
is_show_reset_button = dto.IsShowResetButton,
is_show_export_button = dto.IsShowExportButton,
is_show_import_button = dto.IsShowImportButton,
is_show_sequence_column = dto.IsShowSequenceColumn,
is_show_column_search = dto.IsShowColumnSearch,
is_show_search_button = dto.IsShowSearchButton ?? false,
is_show_reset_button = dto.IsShowResetButton ?? false,
is_show_export_button = dto.IsShowExportButton ?? false,
is_show_import_button = dto.IsShowImportButton ?? false,
is_show_sequence_column = dto.IsShowSequenceColumn ?? false,
is_show_column_search = dto.IsShowColumnSearch ?? false,
column_type = dto.ColumnType,
column_value = dto.ColumnType == ColumnTypeEnum.Config && dto.ListColumn?.Count() > 0 ? JsonConvert.SerializeObject(dto.ListColumn) : dto.ColumnValue,
data_type = dto.DataType,
......@@ -551,11 +551,11 @@ namespace Bailun.DC.Services.Component
operate_column_name = dto.OperateColumnName,
operate_column_width = dto.OperateColumnWidth,
gmt_modified = DateTime.Now,
crumbs = JsonConvert.SerializeObject(dto.ListCrumb),
javascript_src = JsonConvert.SerializeObject(dto.ListJavascriptSrc),
filter_controls = JsonConvert.SerializeObject(dto.ListFilterControl),
operate_controls = JsonConvert.SerializeObject(dto.ListOperateControl),
operate_column_value = JsonConvert.SerializeObject(dto.ListOperateColumnControl),
crumbs = dto.ListCrumb.Count(l => !string.IsNullOrWhiteSpace(l) && !l.Equals("null", StringComparison.OrdinalIgnoreCase)) > 0 ? JsonConvert.SerializeObject(dto.ListCrumb) : null,
javascript_src = dto.ListJavascriptSrc?.Count(l => !string.IsNullOrWhiteSpace(l) && !l.Equals("null", StringComparison.OrdinalIgnoreCase)) > 0 ? JsonConvert.SerializeObject(dto.ListJavascriptSrc) : null,
filter_controls = dto.ListFilterControl?.Count(l => !string.IsNullOrWhiteSpace(l.ToString()) && !l.ToString().Equals("null", StringComparison.OrdinalIgnoreCase)) > 0 ? JsonConvert.SerializeObject(dto.ListFilterControl) : null,
operate_controls = dto.ListOperateControl?.Count(l => !string.IsNullOrWhiteSpace(l.ToString()) && !l.ToString().Equals("null", StringComparison.OrdinalIgnoreCase)) > 0 ? JsonConvert.SerializeObject(dto.ListOperateControl) : null,
operate_column_value = dto.ListOperateColumnControl?.Count(l => !string.IsNullOrWhiteSpace(l.ToString()) && !l.ToString().Equals("null", StringComparison.OrdinalIgnoreCase)) > 0 ? JsonConvert.SerializeObject(dto.ListOperateColumnControl) : null,
};
using (var db = DB)
{
......@@ -795,9 +795,9 @@ namespace Bailun.DC.Services.Component
{
result.Message = "名称不能为空";
}
else if (string.IsNullOrWhiteSpace(dto.Name))
else if (DB.QueryFirstOrDefault<int>($"select count(id) from dc_component_table where code = @code {(dto.Id > 0 ? "and id <> @id" : string.Empty)}", new { id = dto.Id, code = dto.Code }) > 0)
{
result.Message = "名称不能为空";
result.Message = "编码重复";
}
else
{
......
......@@ -35,12 +35,37 @@
v-bind:index="onSequenceIndex"
label="序号"
width="60"
align="center" />
align="center">
</el-table-column>
<el-table-column v-if="setting.listOperateColumnControl && setting.listOperateColumnControl.length > 0"
v-bind:label="setting.operateColumnName || '操作'"
header-align="center"
v-bind:label="setting.operateColumnName || '操作'"
v-bind:show-overflow-tooltip="setting.showTooltip"
v-bind:width="setting.operateColumnWidth || 80">
v-bind:width="setting.operateColumnWidth || 80"
v-bind:label-class-name="setting.isShowColumnSearch ? 'el-table-operate-column-head' : ''">
<div v-if="setting.isShowColumnSearch"
class="el-table-column-search"
v-bind:slot="setting.isShowColumnSearch ? 'header' : ''" slot-scope="scope">
</div>
<el-table-column v-if="setting.listOperateColumnControl && setting.listOperateColumnControl.length > 0"
header-align="center"
v-bind:label="setting.operateColumnName || '操作'"
v-bind:show-overflow-tooltip="setting.showTooltip"
v-bind:width="setting.operateColumnWidth || 80">
<template slot-scope="scope">
<el-form-control v-for="(operateColumn,index) in setting.listOperateColumnControl"
v-if="!operateColumn.isHide || !javaScript.call(scope,operateColumn.isHide,scope)"
class="inline"
v-bind:key="index"
v-bind:item="operateColumn"
v-bind:scope="scope"
v-bind:disabled="operateColumn.disabled != null && (operateColumn.disabled == true || javaScript.call(setting,operateColumn.disabled,scope))"
v-model="scope.row[operateColumn.prop]"
v-on:click="javaScript.call(scope,operateColumn.click,scope)"
v-on:change="javaScript.call(scope,operateColumn.change,scope)">
</el-form-control>
</template>
</el-table-column>
<template slot-scope="scope">
<el-form-control v-for="(operateColumn,index) in setting.listOperateColumnControl"
v-if="!operateColumn.isHide || !javaScript.call(scope,operateColumn.isHide,scope)"
......
......@@ -15,3 +15,8 @@
.el-table-control .el-table__header th.el-table__cell {
padding: 0px;
}
.el-table-control th.el-table-operate-column-head {
background: white !important;
border-top: 3px #F5F7FA solid;
}
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