Commit 439b530b by jianshuqin

优化:组件功能

parent 729d2114
......@@ -27,7 +27,7 @@ namespace Bailun.DC.Web.Areas.Component.Controllers
}
[HttpPost]
public JsonResult Save([FromBody]FormDTO dto)
public JsonResult Save([FromBody] FormDTO dto)
{
ResultDTO result = default(ResultDTO);
try
......@@ -48,7 +48,7 @@ namespace Bailun.DC.Web.Areas.Component.Controllers
ResultDTO result = default(ResultDTO);
try
{
result = new FormService().Save(id, true);
result = new FormService().Save(id, false);
}
catch (Exception ex)
{
......@@ -65,7 +65,7 @@ namespace Bailun.DC.Web.Areas.Component.Controllers
ResultDTO result = default(ResultDTO);
try
{
result = new FormService().Save(id, false);
result = new FormService().Save(id, true);
}
catch (Exception ex)
{
......
......@@ -4,10 +4,11 @@
class="el-dialog-form"
el-dialog
append-to-body
destroy-on-close
v-dialogDrag
v-bind:title="dialog.name"
v-bind:visible.sync="show"
v-bind:width="dialog.width + 'px'"
v-bind:style="{'width':dialog.width > 0 ? (dialog.width + 'px') : ''}"
v-bind:close-on-click-modal="false"
v-on:close="closeDialog">
<el-container v-bind:style="$parent.$el && $parent.$el.offsetHeight ? 'max-height:' + ($parent.$el.offsetHeight - 30) + 'px' : ''">
......
......@@ -42,6 +42,7 @@
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"
......
......@@ -20,28 +20,32 @@
width: auto;
}
.el-form-filter .el-form-button .el-form-control {
margin-right: 10px;
}
.el-form-filter .h40.el-row .el-form-control {
margin-left: 10px;
}
.el-form-filter .el-form-button .el-form-control {
margin-right: 10px;
}
.el-form-filter .el-col {
margin-bottom: 5px;
}
.el-form-filter .el-date-editor.el-input .el-input__inner {
cursor: pointer;
padding-right: 35px;
padding-left: 15px;
}
.el-form-filter .el-date-editor.el-input .el-input__inner {
cursor: pointer;
padding-right: 35px;
padding-left: 15px;
}
.el-form-filter .el-date-editor.el-input .el-input__prefix {
right: 0px;
left: auto;
}
.el-form-filter .el-date-editor.el-input .el-input__prefix {
right: 0px;
left: auto;
}
.el-form-filter .el-date-editor.el-input .el-input__suffix {
right: 16px;
}
.el-form-filter .el-date-editor.el-input .el-input__suffix {
right: 16px;
}
.el-form-filter .el-select__caret.el-input__icon {
height: 94%;
......@@ -49,4 +53,4 @@
.el-form-filter .el-select__caret.el-input__icon.el-icon-circle-close {
height: 90%;
}
\ No newline at end of file
}
......@@ -35,7 +35,7 @@
that.$http({
method: 'get',
url: "/Component/Form/Get",
params: { code: that.code }
params: { code: code || that.code }
}).then(function (response) {
var result = response.data;
if (response.status === 200 && result.result && result.data) {
......@@ -73,12 +73,18 @@
},
//隐藏
closeDialog: function () {
if (!this.show) {
this.$set(this, "form", {})
this.$emit("cancel")
this.$refs.form && this.$refs.form.resetFields && this.$refs.form.resetFields()
var that = this;
if (!that.show) {
that.$set(that, "form", {})
that.$emit("cancel")
var resetFieldsIndex = that.dialog.listFormItem && that.dialog.listFormItem.findIndex(function (l, i) {
return (l.type == "input" || l.type == "number" || l.type == "select" || l.type == "daterange" || l.type == "date" || l.type == "month" || l.type == "year" || l.type == "switch");
});
if (resetFieldsIndex > 0) {
that.$refs.form && that.$refs.form.resetFields && that.$refs.form.resetFields();
};
}
this.show = false
that.show = false
},
//提交表单
submitForm: function () {
......
......@@ -59,6 +59,10 @@
})
}
},
//清空选择
clearSelection: function () {
this.$refs.table.clearSelection();
},
//关闭弹出窗
closeDialog() {
this.$emit("close-dialog")
......@@ -201,7 +205,7 @@
//表格行点击事件
onRowClick: function (row, column) {
var that = this;
if ((that.setting.operateColumnName || '操作') != column.label) {
if (column && (that.setting.operateColumnName || '操作') != column.label) {
if (that.setting.selectRowMethod == 2) {
this.$refs.table.toggleRowSelection(row, !this.$refs.table.selection || !this.$refs.table.selection.length || this.$refs.table.selection.findIndex(function (l) { return l == row }) < 0);
}
......
......@@ -33,6 +33,10 @@
closeDialog() {
this.$emit("close-dialog")
},
//清空选择
clearSelection: function () {
this.$refs.table.clearSelection();
},
//弹出窗
showDialog(title, form, code) {
this.$emit("show-dialog", title, form, code)
......@@ -65,6 +69,10 @@
Vue.set(that.filterParams, 'listFilter', listFilter);
return listFilter;
},
//获取选择行
getSelectItems: function () {
return this.$refs.table.getSelectItems();
},
//表单组件初始化事件
onInit: function (setting) {
var that = this;
......@@ -154,7 +162,7 @@
row = that.row;
break;
case 2:
rows = that.$refs.table.getSelectItems();
rows = that.getSelectItems();
break;
}
if (fn) {
......
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