Commit fb7d0c77 by jianshuqin

优化:组件功能

parent a0927245
...@@ -293,6 +293,10 @@ namespace Bailun.DC.Services.Component ...@@ -293,6 +293,10 @@ namespace Bailun.DC.Services.Component
} }
dataRow.CreateCell(col).SetCellValue(value.ToString()); dataRow.CreateCell(col).SetCellValue(value.ToString());
} }
else if (dataCount > 65535)
{
dataRow.CreateCell(col).SetCellValue(string.Empty);
}
}); });
} }
} }
......
...@@ -7,6 +7,7 @@ using Newtonsoft.Json; ...@@ -7,6 +7,7 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions;
namespace Bailun.DC.Services.Component namespace Bailun.DC.Services.Component
{ {
...@@ -51,6 +52,19 @@ namespace Bailun.DC.Services.Component ...@@ -51,6 +52,19 @@ namespace Bailun.DC.Services.Component
db = DB; db = DB;
break; break;
} }
//默认参数
var paramIndex = entity.value.IndexOf("@");
if (paramIndex >= 0)
{
foreach (Match item in Regex.Matches(entity.value.Substring(paramIndex), @"^@\w+[^\w]*"))
{
string paramName = item.Value.Substring(1, Regex.Match(item.Value.Substring(1), @"[^\w]*$").Index);
if (!sqlparam.ParameterNames.Contains(paramName))
{
sqlparam.Add(paramName, null);
}
}
}
//查询 //查询
using (db) using (db)
{ {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<el-row v-bind:gutter="10"> <el-row v-bind:gutter="10">
<el-col v-if="filter.listFilterControl && filter.listFilterControl.length" v-bind:span="item.colSpan || 24" v-bind:class="{'auto-width': item.colSpan == null || item.colSpan == 'auto'}" v-for="(item,index) in filter.listFilterControl" v-bind:key="index"> <el-col v-if="filter.listFilterControl && filter.listFilterControl.length" v-bind:span="item.colSpan || 24" v-bind:class="{'auto-width': item.colSpan == null || item.colSpan == 'auto'}" v-for="(item,index) in filter.listFilterControl" v-bind:key="index">
<el-form-item v-if="item.type" <el-form-item v-if="item.type"
v-bind:label="item.name" v-bind:label="item.name"
v-bind:prop="'listFilterControl.' + index + '.value'" v-bind:prop="'listFilterControl.' + index + '.value'"
v-bind:rules="item.rules || (item.required ? { required: true, message: item.message || ('请输入' + item.name)} : null)"> v-bind:rules="item.rules || (item.required ? { required: true, message: item.message || ('请输入' + item.name)} : null)">
<el-form-control v-bind:item="item" v-model="item.value"></el-form-control> <el-form-control v-bind:item="item" v-model="item.value" v-bind:form="filter" v-on:change="onChange(item,$event)"></el-form-control>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col class="el-form-button"> <el-col class="el-form-button">
......
...@@ -96,6 +96,17 @@ ...@@ -96,6 +96,17 @@
console.log(error) console.log(error)
} }
} }
//父级联动
if (item.parentProp) {
if (that.form && that.form.listFilterControl && that.form.listFilterControl.length) {
var parentItem = that.form.listFilterControl.find(function (l) { return l.prop == item.parentProp });
if (parentItem && parentItem.value) {
params[item.parentProp] = parentItem.value;
} else {
params[item.parentProp] = null;
}
}
}
var method = item.apiMethod && item.apiMethod.toLocaleLowerCase() == "post" ? item.apiMethod : 'get'; var method = item.apiMethod && item.apiMethod.toLocaleLowerCase() == "post" ? item.apiMethod : 'get';
that.$http({ that.$http({
method: method, method: method,
......
...@@ -138,6 +138,22 @@ ...@@ -138,6 +138,22 @@
} else { } else {
this.formValidate.push({ field: field, valid: valid, message: message }); this.formValidate.push({ field: field, valid: valid, message: message });
} }
},
//改变事件
onChange: function (item, val) {
var that = this;
switch (item.type) {
case "select":
//联动子项
var listFilter = that.filter.listFilterControl.filter(function (l) { return l.type == "select" && l.parentProp == item.prop });
if (listFilter && listFilter.length) {
listFilter.forEach(function (l) {
Vue.set(l, "value", null);
Vue.set(l, "listOption", null);
})
}
break;
}
} }
}, },
mounted: function () { mounted: function () {
......
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