Commit b39883af by wish_lf

增加功能:流水自动检测

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