Commit b39883af by wish_lf

增加功能:流水自动检测

parent bd0d13ee
using Newtonsoft.Json; using Bailun.DC.Models.Component.Enum;
using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
namespace Bailun.DC.Models.Component.DTO namespace Bailun.DC.Models.Component.DTO
...@@ -41,6 +42,11 @@ namespace Bailun.DC.Models.Component.DTO ...@@ -41,6 +42,11 @@ namespace Bailun.DC.Models.Component.DTO
public bool IsShowImportButton { get; set; } public bool IsShowImportButton { get; set; }
/// <summary> /// <summary>
/// 是否显示顺序列: 1:显示; 0:不显示
/// </summary>
public bool IsShowSequenceColumn { get; set; }
/// <summary>
/// 选择行方式:1: 单选, 2: 多选 /// 选择行方式:1: 单选, 2: 多选
/// </summary> /// </summary>
public int? SelectRowMethod { get; set; } public int? SelectRowMethod { get; set; }
...@@ -48,7 +54,7 @@ namespace Bailun.DC.Models.Component.DTO ...@@ -48,7 +54,7 @@ namespace Bailun.DC.Models.Component.DTO
/// <summary> /// <summary>
/// 列类型: 1: 控制器函数, 2: WebApi, 3:数据源编码, 4:SQL, 5:本地配置 /// 列类型: 1: 控制器函数, 2: WebApi, 3:数据源编码, 4:SQL, 5:本地配置
/// </summary> /// </summary>
public int? ColumnType { get; set; } public ColumnTypeEnum? ColumnType { get; set; }
/// <summary> /// <summary>
/// 列值 /// 列值
...@@ -69,7 +75,7 @@ namespace Bailun.DC.Models.Component.DTO ...@@ -69,7 +75,7 @@ namespace Bailun.DC.Models.Component.DTO
/// <summary> /// <summary>
/// 数据类型:1: 控制器函数, 2: WebApi, 3:数据库表或视图, 4:SQL /// 数据类型:1: 控制器函数, 2: WebApi, 3:数据库表或视图, 4:SQL
/// </summary> /// </summary>
public int? DataType { get; set; } public DataTypeEnum? DataType { get; set; }
/// <summary> /// <summary>
/// 数据值 /// 数据值
...@@ -78,6 +84,12 @@ namespace Bailun.DC.Models.Component.DTO ...@@ -78,6 +84,12 @@ namespace Bailun.DC.Models.Component.DTO
public string DataValue { get; set; } public string DataValue { get; set; }
/// <summary> /// <summary>
/// 数据库:1: 数据中心, 2: 交易流水
/// </summary>
[JsonIgnore]
public DBEnum? DataDB { get; set; }
/// <summary>
/// 数据默认排序SQL /// 数据默认排序SQL
/// </summary> /// </summary>
[JsonIgnore] [JsonIgnore]
......
using System; using Bailun.DC.Models.Component.Enum;
using System;
namespace Bailun.DC.Models.Component.Entity namespace Bailun.DC.Models.Component.Entity
{ {
...@@ -68,6 +69,11 @@ namespace Bailun.DC.Models.Component.Entity ...@@ -68,6 +69,11 @@ namespace Bailun.DC.Models.Component.Entity
public string operate_controls { get; set; } public string operate_controls { get; set; }
/// <summary> /// <summary>
/// 是否显示顺序列: 1:显示; 0:不显示
/// </summary>
public bool is_show_sequence_column { get; set; }
/// <summary>
/// 选择行方式:1: 单选, 2: 多选 /// 选择行方式:1: 单选, 2: 多选
/// </summary> /// </summary>
public int? select_row_method { get; set; } public int? select_row_method { get; set; }
...@@ -75,7 +81,7 @@ namespace Bailun.DC.Models.Component.Entity ...@@ -75,7 +81,7 @@ namespace Bailun.DC.Models.Component.Entity
/// <summary> /// <summary>
/// 列类型: 1: 控制器函数, 2: WebApi, 3:数据源编码, 4:SQL, 5:本地配置 /// 列类型: 1: 控制器函数, 2: WebApi, 3:数据源编码, 4:SQL, 5:本地配置
/// </summary> /// </summary>
public int? column_type { get; set; } public ColumnTypeEnum? column_type { get; set; }
/// <summary> /// <summary>
/// 列值 /// 列值
...@@ -100,7 +106,7 @@ namespace Bailun.DC.Models.Component.Entity ...@@ -100,7 +106,7 @@ namespace Bailun.DC.Models.Component.Entity
/// <summary> /// <summary>
/// 数据类型:1: 控制器函数, 2: WebApi, 3:数据库表或视图, 4:SQL /// 数据类型:1: 控制器函数, 2: WebApi, 3:数据库表或视图, 4:SQL
/// </summary> /// </summary>
public int? data_type { get; set; } public DataTypeEnum? data_type { get; set; }
/// <summary> /// <summary>
/// 列值 /// 列值
...@@ -113,6 +119,11 @@ namespace Bailun.DC.Models.Component.Entity ...@@ -113,6 +119,11 @@ namespace Bailun.DC.Models.Component.Entity
public string data_sort_sql { get; set; } public string data_sort_sql { get; set; }
/// <summary> /// <summary>
/// 数据库:1: 数据中心, 2: 交易流水
/// </summary>
public DBEnum? data_db { get; set; }
/// <summary>
/// 是否自动查询: 1:是; 0:否 /// 是否自动查询: 1:是; 0:否
/// </summary> /// </summary>
public bool is_auto_search { get; set; } public bool is_auto_search { get; set; }
......
...@@ -3,34 +3,21 @@ ...@@ -3,34 +3,21 @@
namespace Bailun.DC.Models.Component.Enum namespace Bailun.DC.Models.Component.Enum
{ {
/// <summary> /// <summary>
/// 列名类型:1:控制器函数,2:WEBAPI,3:数据源编码,4:SQL,5:本地配置 /// 列名类型:1:API,2:SQL,3:本地配置
/// </summary> /// </summary>
public enum ColumnTypeEnum public enum ColumnTypeEnum
{ {
/// <summary> [Description("API")]
/// 控制器函数 Api = 1,
/// </summary>
[Description("控制器函数")]
Controller = 1,
/// <summary>
/// WEBAPI
/// </summary>
[Description("WEBAPI")]
Webapi = 2,
/// <summary>
/// 数据源编码
/// </summary>
[Description("数据源编码")]
DataSourceCode = 3,
/// <summary> /// <summary>
/// SQL /// SQL
/// </summary> /// </summary>
[Description("SQL")] [Description("SQL")]
Sql = 4, Sql = 2,
/// <summary> /// <summary>
/// 本地配置 /// 本地配置
/// </summary> /// </summary>
[Description("本地配置")] [Description("配置")]
Config = 5 Config = 3
} }
} }
using System.ComponentModel;
namespace Bailun.DC.Models.Component.Enum
{
/// <summary>
/// 数据库:1: 数据中心, 2: 交易流水
/// </summary>
public enum DBEnum
{
/// <summary>
/// 数据中心
/// </summary>
[Description("数据中心")]
DataCenter = 1,
/// <summary>
/// 交易流水
/// </summary>
[Description("交易流水")]
DataWareHouse = 2
}
}
...@@ -3,39 +3,38 @@ ...@@ -3,39 +3,38 @@
namespace Bailun.DC.Models.Component.Enum namespace Bailun.DC.Models.Component.Enum
{ {
/// <summary> /// <summary>
/// 列名类型:1:控制器函数,2:WEBAPI,3:数据库表或视图,4:SQL,5:动态SQL,6:储存过程 /// 列名类型:1:Api,2:Sql,3:数据库表或视图,4:动态SQL,5:储存过程
/// </summary> /// </summary>
public enum DataTypeEnum public enum DataTypeEnum
{ {
/// <summary> /// <summary>
/// 控制器函数 /// API
/// </summary> /// </summary>
[Description("控制器函数")] [Description("Api")]
Controller = 1, Api = 1,
/// <summary> /// <summary>
/// WEBAPI /// SQL
/// </summary> /// </summary>
[Description("WEBAPI")] [Description("SQL")]
Webapi = 2, Sql = 2,
/// <summary> /// <summary>
/// 数据源编数据库表或视图码 /// 数据库表或视图
/// </summary> /// </summary>
[Description("数据库表或视图")] [Description("数据库表或视图")]
Table = 3, Table = 3,
/// <summary> /// <summary>
/// SQL /// 动态SQL
/// </summary>
[Description("SQL")]
Sql = 4,
/// <summary>
/// SQL
/// </summary> /// </summary>
[Description("动态SQL")] [Description("动态SQL")]
DynamicSql = 5, DynamicSql = 4,
/// <summary> /// <summary>
/// 储存过程 /// 储存过程
/// </summary> /// </summary>
[Description("储存过程")] [Description("储存过程")]
ExecuteSql = 6, ExecuteSql = 5,
} }
} }
...@@ -8,10 +8,6 @@ namespace Bailun.DC.Web.Areas.Component.Controllers ...@@ -8,10 +8,6 @@ namespace Bailun.DC.Web.Areas.Component.Controllers
[Area("Component")] [Area("Component")]
public class QueryController : Base.BaseController public class QueryController : Base.BaseController
{ {
public IActionResult Index()
{
return View();
}
[HttpGet] [HttpGet]
public JsonResult Get(string code = null) public JsonResult Get(string code = null)
......
using Bailun.DC.Models.Component.DTO;
using Bailun.DC.Services.Component;
using Microsoft.AspNetCore.Mvc;
using System;
namespace Bailun.DC.Web.Areas.Component.Controllers
{
[Area("Component")]
public class TableController : Base.BaseController
{
public IActionResult Index()
{
return View();
}
}
}
...@@ -39,13 +39,16 @@ ...@@ -39,13 +39,16 @@
v-bind:value="option[item.value] || option.value"> v-bind:value="option[item.value] || option.value">
</el-option> </el-option>
</el-select> </el-select>
<el-date-picker v-else-if="item.type == 'date'" <el-date-picker v-else-if="item.type == 'date' || item.type == 'daterange'"
v-model="item_value" v-model="item_value"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
v-bind:clearable="item.clearable == null || item.clearable" v-bind:clearable="item.clearable == null || item.clearable"
v-bind:disabled="disabled || (disabled == null && item.disabled != null && (item.disabled == true || javaScript.call(this,item.disabled)))" v-bind:disabled="disabled || (disabled == null && item.disabled != null && (item.disabled == true || javaScript.call(this,item.disabled)))"
v-bind:placeholder="item.placeholder || ('请选择' + (item.label || item.name || ''))" v-bind:placeholder="item.placeholder || ('请选择' + (item.label || item.name || ''))"
v-bind:size="item.size || 'small'" v-bind:size="item.size || 'small'"
type="date" v-bind:type="item.type"
value-format="yyyy/MM/dd" value-format="yyyy/MM/dd"
v-bind:picker-options="{shortcuts: [{text: '今天',onClick:function(picker) {picker.$emit('pick', new Date())}}]}"> v-bind:picker-options="{shortcuts: [{text: '今天',onClick:function(picker) {picker.$emit('pick', new Date())}}]}">
</el-date-picker> </el-date-picker>
......
@{
ViewData["Title"] = "自动对账面板";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "自动对账", "情况表" };
}
@section css{
<link href="@Url.Content("~/css/vue/v-cloak.css")" rel="stylesheet" />
<link href="@Url.Content("~/css/vue/element-ui-2.15.6.css")" rel="stylesheet" />
<link href="@Url.Content("~/css/component/query-table.css")" rel="stylesheet" />
}
@section scripts{
<script src="@Url.Content("~/js/vue/vue-2.6.14.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/vue/element-ui-2.15.6.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/vue/vue-resource.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/component/js.prototype.ex.js")" type="text/javascript"></script>
<script type="text/x-template" id="elQueryTable">
@Html.PartialAsync("~/Areas/Component/Views/Table/Query.cshtml").Result
</script>
<script>
$(document).ready(function () {
new Vue({
el: '#app',
data: {
code: getUrlParam("code")
}
})
})
</script>
}
<div id="app" v-cloak>
<el-query-table v-bind:code="code"></el-query-table>
</div>
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
<el-main> <el-main>
<el-table ref="table" <el-table ref="table"
class="form-table el-table--scrollable-y" class="form-table el-table--scrollable-y"
v-bind:data="listData"
row-key="onRowKey"
stripe stripe
border border
v-bind:data="listData"
v-bind:row-key="id"
v-bind:highlightCurrentRow="setting.selectRowMethod == 1" v-bind:highlightCurrentRow="setting.selectRowMethod == 1"
v-on:sort-change="onSortChange" v-on:sort-change="onSortChange"
v-on:selection-change="onSelectionChange" v-on:selection-change="onSelectionChange"
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
</el-radio> </el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="setting.showIndex" <el-table-column v-if="setting.isShowSequenceColumn"
type="index" type="index"
header-align="center" header-align="center"
v-bind:index="handleIndexCalc" v-bind:index="onSequenceIndex"
label="序号" label="序号"
width="60" width="60"
align="center" /> align="center" />
...@@ -110,5 +110,4 @@ ...@@ -110,5 +110,4 @@
</script> </script>
<script src="@Url.Content("~/js/component/xlsx.full.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/js/component/xlsx.full.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/component/file-saver.js")" type="text/javascript"></script> <script src="@Url.Content("~/js/component/file-saver.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/component/js.prototype.ex.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/component/query-table.js")" type="text/javascript"> <script src="@Url.Content("~/js/component/query-table.js")" type="text/javascript">
...@@ -14,25 +14,18 @@ ...@@ -14,25 +14,18 @@
<script src="@Url.Content("~/js/vue/vue-2.6.14.js")" type="text/javascript"></script> <script src="@Url.Content("~/js/vue/vue-2.6.14.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/vue/element-ui-2.15.6.js")" type="text/javascript"></script> <script src="@Url.Content("~/js/vue/element-ui-2.15.6.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/vue/vue-resource.js")" type="text/javascript"></script> <script src="@Url.Content("~/js/vue/vue-resource.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/component/js.prototype.ex.js")" type="text/javascript"></script>
<script type="text/x-template" id="elQueryTable"> <script type="text/x-template" id="elQueryTable">
@Html.PartialAsync("~/Areas/Component/Views/Table/Query.cshtml").Result @Html.PartialAsync("~/Areas/Component/Views/Table/Query.cshtml").Result
</script> </script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
new Vue({ new Vue({
el: '#app', el: '#app'
data: {
code: "test"
},
created() {
},
mounted() {
},
}) })
}) })
</script> </script>
} }
<div id="app" v-cloak> <div id="app" v-cloak>
<el-query-table v-bind:code="code"></el-query-table> <el-query-table code="dw_auto_check"></el-query-table>
</div> </div>
.wrapper.wrapper-content.animated.fadeInRight { .wrapper.wrapper-content.animated.fadeInRight,
.el-query-table .el-main .el-table .el-table__body-wrapper {
height: calc(100% - 40px); height: calc(100% - 40px);
} }
...@@ -16,11 +17,6 @@ ...@@ -16,11 +17,6 @@
padding-left: 10px; padding-left: 10px;
} }
.el-query-table .el-main .el-table .el-table__body-wrapper {
height: 100%
}
.el-query-table .el-form-item { .el-query-table .el-form-item {
margin-bottom: 0px; margin-bottom: 0px;
margin-top: 5px; margin-top: 5px;
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
that.onSearch(); that.onSearch();
} }
} else { } else {
this.$message(result.Message || " 未知错误!"); this.$message((!result.data && "配置错误") || (result.Message || " 未知错误!"));
} }
that.loading = false; that.loading = false;
}, function (error) { }, function (error) {
...@@ -108,13 +108,13 @@ ...@@ -108,13 +108,13 @@
that.setting.listFilterControl.forEach(function (l) { that.setting.listFilterControl.forEach(function (l) {
if (l.value) { if (l.value) {
var filter = { field: l.prop }; var filter = { field: l.prop };
//数据 //日期区间
if (l.value.constructor === Array && l.value == 2) { if (l.type == "daterange") {
filter.operator = "between"; filter.operator = "between";
filter.value = l.value.join(","); filter.value = l.value.join(",");
} }
//对象 //对象
else if (l.value.constructor === Object) { else if (l.value.constructor === Object || l.value.constructor === Array) {
filter.operator = "in"; filter.operator = "in";
filter.value = l.value.join(","); filter.value = l.value.join(",");
} }
...@@ -176,33 +176,31 @@ ...@@ -176,33 +176,31 @@
//查询字段 //查询字段
onSearchColumn: function (isRefreshListOption) { onSearchColumn: function (isRefreshListOption) {
var that = this; var that = this;
that.loading = true;
that.getQueryFilter(); that.getQueryFilter();
that.$http({ that.$http.post("/Component/Query/GetListColumn", that.filterParams, { emulateJSON: true }).then(function (response) {
method: 'post', var result = response.data;
url: SysUrl + "/DataSourceQuery/GetListColumn?code=" + that.code, if (response.status === 200 && result.result && result.data) {
data: that.query
}).then(function (resp) {
var result = resp.data;
if (resp.status === 200 && result.Result && result.Data) {
if (isRefreshListOption) { if (isRefreshListOption) {
if (result.Data && result.Data.length) { if (result.data && result.data.length) {
that.listColumn.forEach(function (l) { that.listColumn.forEach(function (l) {
var column = result.Data.find(function (l2) { var column = result.data.find(function (l2) {
return l.Code == l2.Code; return l.code == l2.code;
}); });
if (column) { if (column) {
Vue.set(l, "ListOption", column.ListOption); Vue.set(l, "listOption", column.listOption);
} }
}); });
} }
} else { } else {
Vue.set(that, "listColumn", result.Data); Vue.set(that.setting, "listColumn", result.data);
} }
} else { } else {
this.$message(result.Message || " 未知错误!"); this.$message(result.message || " 未知错误!");
} }
}, function (error) { }, function (error) {
this.$message(error); this.$message(error.statusText || " 未知错误!");
that.loading = false;
}); });
}, },
//查询数据 //查询数据
...@@ -227,7 +225,7 @@ ...@@ -227,7 +225,7 @@
//查询 //查询
onSearch: function () { onSearch: function () {
var that = this; var that = this;
if (!that.setting || that.setting.columnType != 5) { if (!that.setting || that.setting.columnType != 3) {
this.onSearchColumn(); this.onSearchColumn();
} }
this.onSearchData(); this.onSearchData();
...@@ -371,15 +369,6 @@ ...@@ -371,15 +369,6 @@
} }
} }
}, },
//绑定行KEY
onRowKey: function (obj) {
//多选绑定Key
var key = obj.ID
if (!key) {
key = JSON.stringify(obj);
}
return key;
},
//排序 //排序
onSortChange: function (column) { onSortChange: function (column) {
var that = this; var that = this;
...@@ -412,6 +401,10 @@ ...@@ -412,6 +401,10 @@
this.rows = selection this.rows = selection
this.$emit("selection-change", selection) this.$emit("selection-change", selection)
}, },
//顺序号
onSequenceIndex: function (index) {
return (this.filterParams.currentPage - 1) * this.filterParams.pageSize + index + 1;
},
/** 自定义JS */ /** 自定义JS */
javaScript(js, scope) { javaScript(js, scope) {
if (js) { if (js) {
......
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