Commit a13cbe9a authored by 杨柠瑞's avatar 杨柠瑞

coding

parent 8b2ba5e8
...@@ -147,8 +147,11 @@ ...@@ -147,8 +147,11 @@
:formStyle="HmComplexForm.formStyle" :formStyle="HmComplexForm.formStyle"
:funObject="HmComplexForm.funObject" :funObject="HmComplexForm.funObject"
:refers="HmComplexForm.formRefers" :refers="HmComplexForm.formRefers"
:includes="HmComplexForm.formIncludes"
:foreignFormFields="HmComplexForm.foreignFormFields" :foreignFormFields="HmComplexForm.foreignFormFields"
:relates="HmComplexForm.formRelates" > :relates="HmComplexForm.formRelates"
:rules="HmComplexForm.rules"
v-on:formVisible='dialogClose'>
</hm-complex-form> </hm-complex-form>
</el-dialog> </el-dialog>
...@@ -394,15 +397,19 @@ ...@@ -394,15 +397,19 @@
formStyle: {}, formStyle: {},
funObject: {}, funObject: {},
formRefers: {}, formRefers: {},
formIncludes: {},
foreignFormFields: [], foreignFormFields: [],
formRelates: [] formRelates: [],
rules: {
}
}, },
showOverflowTooltip: false, // 设置当内容过长被隐藏时显示 tooltip showOverflowTooltip: false, // 设置当内容过长被隐藏时显示 tooltip
HmFullCalendar: {}, // HmFullCalendar: {}, //
isShowRefresh: false, isShowRefresh: false,
buttonGroup: false, buttonGroup: false,
operationWidth: 0, // 操作栏的宽度 operationWidth: 20, // 操作栏的宽度
isShowDetail: false, // 是否显示详情按钮 isShowDetail: false, // 是否显示详情按钮
definedOperate: [], // 自定义操作 definedOperate: [], // 自定义操作
...@@ -450,6 +457,7 @@ ...@@ -450,6 +457,7 @@
// this.validate() // this.validate()
const self = this const self = this
if (this.userDefined && this.userDefined.pretreatment) { if (this.userDefined && this.userDefined.pretreatment) {
self.init()
self.userDefined.pretreatment().then(function() { self.userDefined.pretreatment().then(function() {
self.init() self.init()
self.getList() self.getList()
...@@ -487,7 +495,7 @@ ...@@ -487,7 +495,7 @@
init() { init() {
const self = this const self = this
self.operationWidth = 0 self.operationWidth = 20
// 处理要显示的列 // 处理要显示的列
if (!self.columns || !self.columns.length) { if (!self.columns || !self.columns.length) {
_.each(self.schema['columns'], function(column) { _.each(self.schema['columns'], function(column) {
...@@ -549,8 +557,19 @@ ...@@ -549,8 +557,19 @@
self.definedOperate = self.userDefined.definedOperate self.definedOperate = self.userDefined.definedOperate
} }
if (self.userDefined.definedOperation) { if (self.userDefined.definedOperation) {
_.each(self.userDefined.definedOperation, function(item) { _.each(self.userDefined.definedOperation, function(item, index) {
self.operationWidth += 22 * item.label.length _.each(item.label, function(value) {
if (!isNaN(Number(value))) {
self.operationWidth += 8 // 如果是数字+8
} else {
self.operationWidth += 13 // 如果是汉字加13
}
})
if (self.userDefined.definedOperation.length > 1 && index > 1) {
self.operationWidth += 13 // 每添加一条需加上margin
} else {
self.operationWidth += 5
}
}) })
self.definedOperation = self.userDefined.definedOperation self.definedOperation = self.userDefined.definedOperation
} }
...@@ -681,6 +700,7 @@ ...@@ -681,6 +700,7 @@
formStyle: {}, formStyle: {},
funObject: {}, funObject: {},
formRefers: {}, formRefers: {},
formIncludes: {},
foreignFormFields: [], foreignFormFields: [],
formRelates: [] formRelates: []
} }
...@@ -698,6 +718,7 @@ ...@@ -698,6 +718,7 @@
self.options.editData.formStyle ? self.HmComplexForm.formStyle = self.options.editData.formStyle : '' self.options.editData.formStyle ? self.HmComplexForm.formStyle = self.options.editData.formStyle : ''
self.options.editData.funObject ? self.HmComplexForm.funObject = self.options.editData.funObject : '' self.options.editData.funObject ? self.HmComplexForm.funObject = self.options.editData.funObject : ''
self.options.editData.formRefers ? self.HmComplexForm.formRefers = self.options.editData.formRefers : '' self.options.editData.formRefers ? self.HmComplexForm.formRefers = self.options.editData.formRefers : ''
self.options.editData.formIncludes ? self.HmComplexForm.formIncludes = self.options.editData.formIncludes : ''
self.options.editData.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.editData.foreignFormFields : '' self.options.editData.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.editData.foreignFormFields : ''
self.options.editData.formRelates ? self.HmComplexForm.formRelates = self.options.editData.formRelates : '' self.options.editData.formRelates ? self.HmComplexForm.formRelates = self.options.editData.formRelates : ''
} }
...@@ -713,6 +734,7 @@ ...@@ -713,6 +734,7 @@
self.options.newData.formStyle ? self.HmComplexForm.formStyle = self.options.newData.formStyle : '' self.options.newData.formStyle ? self.HmComplexForm.formStyle = self.options.newData.formStyle : ''
self.options.newData.funObject ? self.HmComplexForm.funObject = self.options.newData.funObject : '' self.options.newData.funObject ? self.HmComplexForm.funObject = self.options.newData.funObject : ''
self.options.newData.formRefers ? self.HmComplexForm.formRefers = self.options.newData.formRefers : '' self.options.newData.formRefers ? self.HmComplexForm.formRefers = self.options.newData.formRefers : ''
self.options.newData.formIncludes ? self.HmComplexForm.formIncludes = self.options.newData.formIncludes : ''
self.options.newData.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.newData.foreignFormFields : '' self.options.newData.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.newData.foreignFormFields : ''
self.options.newData.formRelates ? self.HmComplexForm.formRelates = self.options.newData.formRelates : '' self.options.newData.formRelates ? self.HmComplexForm.formRelates = self.options.newData.formRelates : ''
} }
...@@ -729,9 +751,15 @@ ...@@ -729,9 +751,15 @@
self.options.showDetail.formStyle ? self.HmComplexForm.formStyle = self.options.showDetail.formStyle : '' self.options.showDetail.formStyle ? self.HmComplexForm.formStyle = self.options.showDetail.formStyle : ''
self.options.showDetail.funObject ? self.HmComplexForm.funObject = self.options.showDetail.funObject : '' self.options.showDetail.funObject ? self.HmComplexForm.funObject = self.options.showDetail.funObject : ''
self.options.showDetail.formRefers ? self.HmComplexForm.formRefers = self.options.showDetail.formRefers : '' self.options.showDetail.formRefers ? self.HmComplexForm.formRefers = self.options.showDetail.formRefers : ''
self.options.showDetail.formIncludes ? self.HmComplexForm.formIncludes = self.options.showDetail.formIncludes : ''
self.options.showDetail.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.showDetail.foreignFormFields : '' self.options.showDetail.foreignFormFields ? self.HmComplexForm.foreignFormFields = self.options.showDetail.foreignFormFields : ''
self.options.showDetail.formRelates ? self.HmComplexForm.formRelates = self.options.showDetail.formRelates : '' self.options.showDetail.formRelates ? self.HmComplexForm.formRelates = self.options.showDetail.formRelates : ''
self.HmComplexForm.tableId = data.id self.HmComplexForm.tableId = data.id
// wk 2018年05月09日11:57:06
if (self.options.showDetail.funCallback) {
self.options.showDetail.funCallback(data)
}
} }
self.dialogFormVisible = true self.dialogFormVisible = true
...@@ -837,7 +865,7 @@ ...@@ -837,7 +865,7 @@
} }
if (self.options.editData && self.options.editData.isShow) { // 判断是否显示编辑按钮 if (self.options.editData && self.options.editData.isShow) { // 判断是否显示编辑按钮
self.isShowEditDataButton = self.options.editData.isShow self.isShowEditDataButton = self.options.editData.isShow
self.operationWidth += 50 self.operationWidth += 30
} }
if (self.options.showRefresh) { // 判断是否显示刷新按钮 if (self.options.showRefresh) { // 判断是否显示刷新按钮
self.isShowRefresh = self.options.showRefresh self.isShowRefresh = self.options.showRefresh
...@@ -856,14 +884,14 @@ ...@@ -856,14 +884,14 @@
} }
if (self.options.showDeleteButton) { // 判断是否显示删除按钮 if (self.options.showDeleteButton) { // 判断是否显示删除按钮
self.isShowDeleteButton = self.options.showDeleteButton self.isShowDeleteButton = self.options.showDeleteButton
self.operationWidth += 50 self.operationWidth += 30
} }
if (self.options.buttonGroup) { // 设置按钮是否以按钮组呈现 if (self.options.buttonGroup) { // 设置按钮是否以按钮组呈现
self.buttonGroup = self.options.buttonGroup self.buttonGroup = self.options.buttonGroup
} }
if (self.options.showDetail && self.options.showDetail.isShow) { // 设置按钮是否以按钮组呈现 if (self.options.showDetail && self.options.showDetail.isShow) { // 设置按钮是否以按钮组呈现
self.isShowDetail = self.options.showDetail.isShow self.isShowDetail = self.options.showDetail.isShow
self.operationWidth += 50 self.operationWidth += 30
} }
if (self.options.showSelection) { // 设置是否显示多选 if (self.options.showSelection) { // 设置是否显示多选
self.isShowSelection = self.options.showSelection self.isShowSelection = self.options.showSelection
...@@ -947,6 +975,10 @@ ...@@ -947,6 +975,10 @@
}, },
getFilterOperTwin(filter) { getFilterOperTwin(filter) {
return Object.keys(filter[this.getFilterColumn(filter)])[1] return Object.keys(filter[this.getFilterColumn(filter)])[1]
},
dialogClose() {
this.dialogFormVisible = false
this.getList()
} }
} }
} }
......
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