Commit bf3ed7ac authored by 郜超's avatar 郜超

Merge branch 'master' of 115.28.80.125:softwarefactory/vueelementtemplate

parents 0767217a aad90771
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
:layout="layout" :layout="layout"
:tips="tips" :tips="tips"
:funObject="funObject" :funObject="funObject"
:refers="userRefers" >
:foreignFormFields="foreignFormFields"
:relates="userRelates">
<!-- foreignFormFields 主查外的外表显示字段 和userRefers连用--> <!-- foreignFormFields 主查外的外表显示字段 和userRefers连用-->
<!-- :relates="userRelates" 中间表和间接关联表--> <!-- :relates="userRelates" 中间表和间接关联表-->
<!-- :refers="userRefers" 主查外的外表和外键字段 和foreignFormFields;连用--> <!-- :refers="userRefers" 主查外的外表和外键字段 和foreignFormFields;连用-->
...@@ -48,15 +46,16 @@ ...@@ -48,15 +46,16 @@
// ] // ]
}, },
// 2下拉框 // 2下拉框
{ name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false, // { name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false,
change: this.inputChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3] // change: this.selectChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3]
options: [ // allowCreate: true,
{ value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值 // options: [
{ value: '2', label: '代理商' }, // { value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值
{ value: '3', label: '会员' }, // { value: '2', label: '代理商' },
{ value: '4', label: '访客' } // { value: '3', label: '会员' },
] // { value: '4', label: '访客' }
}, // ]
// },
// 3多选 不支持默认值 // 3多选 不支持默认值
{ name: '部门ID', codeCamel: 'departmentId', widgetType: 3, options: ['美女', '帅哥'], change: this.inputChange }, { name: '部门ID', codeCamel: 'departmentId', widgetType: 3, options: ['美女', '帅哥'], change: this.inputChange },
// 4密码 // 4密码
...@@ -73,9 +72,11 @@ ...@@ -73,9 +72,11 @@
{ label: 1, value: '会员' }, // 单选的value是选项文字,label是选中值 { label: 1, value: '会员' }, // 单选的value是选项文字,label是选中值
{ label: 2, value: '访客' } // 如果数据库中存的数据类型是number,label值写number如1,如果为string,label值写string ,如'1' { label: 2, value: '访客' } // 如果数据库中存的数据类型是number,label值写number如1,如果为string,label值写string ,如'1'
], // default: 1 ], // default: 1
change: this.inputChange }, change: this.inputChange
},
// 8文件 change: this.uploadChange // 8文件 change: this.uploadChange
{ name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture', accept: 'image/*' } // url是后台接口地址 { name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture' }, // url是后台接口地址
{ name: '用户名称', codeCamel: 'username', widgetType: 8, url: '/api/upload', param: 'picture' } // url是后台接口地址
], ],
// CcSubject示例 // CcSubject示例
showUserColumns2: [ showUserColumns2: [
...@@ -105,11 +106,12 @@ ...@@ -105,11 +106,12 @@
includes: ['ccSubjectId'] includes: ['ccSubjectId']
} }
}, },
// userIncludes: { // 外查主
// 'hm_user': { userIncludes: {
// includes: ['user_id'] 'hm_user': {
// } includes: ['user_id']
// }, }
},
// 要显示按钮 // 要显示按钮
showUserButtons: [ showUserButtons: [
{ text: '确定', type: 1, method: this.method1, beforeSubmit: this.processData }, { text: '确定', type: 1, method: this.method1, beforeSubmit: this.processData },
...@@ -120,7 +122,8 @@ ...@@ -120,7 +122,8 @@
{ text: '取消', type: 3, method: this.method3 } { text: '取消', type: 3, method: this.method3 }
], ],
funObject: { funObject: {
beforeRender: this.beforeRender beforeRender: this.beforeRender,
uploadFun: this.uploadFun
}, },
// showUserButtons: [] // showUserButtons: []
// 布局方式 // 布局方式
...@@ -143,6 +146,7 @@ ...@@ -143,6 +146,7 @@
datePicker: { style: { width: '60%' }}, datePicker: { style: { width: '60%' }},
input: { style: { width: '60%' }}, input: { style: { width: '60%' }},
select: { style: { width: '60%' }}, select: { style: { width: '60%' }},
cascader: { style: { width: '60%' }},
textarea: { textarea: {
style: { width: '60%' }, style: { width: '60%' },
resize: 'none', resize: 'none',
...@@ -179,10 +183,13 @@ ...@@ -179,10 +183,13 @@
}, },
methods: { methods: {
inputChange(val, formModel) { inputChange(val, formModel) {
console.log(val) // console.log(val)
console.log(formModel) // console.log(formModel)
// formModel.email = val.length // formModel.email = val.length
}, },
selectChange(val, formModel) {
console.log('下拉框change', val, formModel)
},
processData(object, isCancel) { processData(object, isCancel) {
isCancel.cancelSubmit = false // 如果要取消提交,设为true isCancel.cancelSubmit = false // 如果要取消提交,设为true
console.log(125, object) console.log(125, object)
...@@ -211,6 +218,12 @@ ...@@ -211,6 +218,12 @@
// console.log(111, data) // console.log(111, data)
// console.log(112, formModel) // console.log(112, formModel)
return formModel return formModel
},
uploadFun: function(response, formModel) {
// console.log(215, response)
// console.log(216, formModel)
// 修改其他表单的值
formModel.email = response.visitName
} }
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
userFilters: [ userFilters: [
{ placeholder: '过滤手机号', 'mobile': { 'like': '' }, isShow: true }, { placeholder: '过滤手机号', 'mobile': { 'like': '' }, isShow: true },
{ placeholder: '过滤用户名', 'username': { 'equalTo': '' }, isShow: true }, { placeholder: '过滤用户名', 'username': { 'equalTo': '' }, isShow: true },
{ placeholder: ['安全级别大于', '安全级别小于'], 'create_time': { 'greaterThanOrEqualTo': '', 'lessThanOrEqualTo': '' }, isShow: true } { placeholder: ['安全级别大于', '安全级别小于'], 'security_level': { 'greaterThanOrEqualTo': '', 'lessThanOrEqualTo': '' }, isShow: true }
], ],
userIncludes: { userIncludes: {
'hm_user': { 'hm_user': {
......
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