|
|
|
@ -107,6 +107,7 @@
|
|
|
|
selectItem: [], //自定义下拉内容,先绑定数组后转为对象
|
|
|
|
selectItem: [], //自定义下拉内容,先绑定数组后转为对象
|
|
|
|
validation: [], //效验规则
|
|
|
|
validation: [], //效验规则
|
|
|
|
parameters: [], //数据字典
|
|
|
|
parameters: [], //数据字典
|
|
|
|
|
|
|
|
formList:[],
|
|
|
|
forms: [], //表
|
|
|
|
forms: [], //表
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -127,13 +128,13 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 选择数据库字段
|
|
|
|
changeIsUser(e) {
|
|
|
|
changeIsUser(e) {
|
|
|
|
console.log("e", e)
|
|
|
|
console.log("e", e)
|
|
|
|
console.log(this.selectedForm)
|
|
|
|
console.log(this.selectedForm)
|
|
|
|
if(e){
|
|
|
|
if(e){
|
|
|
|
this.selectFormList.map(item => {
|
|
|
|
this.selectFormList.map(item => {
|
|
|
|
if (e === item.belong_user_table) {
|
|
|
|
if (e === item.belong_user_table) {
|
|
|
|
// this.selectedForm = this.base.requestToForm(item,this.selectedForm)
|
|
|
|
|
|
|
|
this.selectedForm.name = item.name
|
|
|
|
this.selectedForm.name = item.name
|
|
|
|
this.selectedForm.field = item.field
|
|
|
|
this.selectedForm.field = item.field
|
|
|
|
this.selectedForm.help = item.help
|
|
|
|
this.selectedForm.help = item.help
|
|
|
|
@ -151,20 +152,44 @@
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
this.selectedForm.belong_user = 0
|
|
|
|
this.selectedForm.belong_user = 0
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
saveField() {
|
|
|
|
saveField() {
|
|
|
|
|
|
|
|
console.log("this.selectedForm.select_item",this.selectedForm)
|
|
|
|
|
|
|
|
if(this.base.isNull(this.selectedForm.name)){
|
|
|
|
|
|
|
|
this.$Message.warning("字段名称不能为空")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.base.isNull(this.selectedForm.field)){
|
|
|
|
|
|
|
|
this.$Message.warning("字段标识不能为空")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
this.selectedForm.select_item = []
|
|
|
|
this.selectedForm.select_item = []
|
|
|
|
this.selectedForm.select_item = this.selectItem
|
|
|
|
this.selectedForm.select_item = this.selectItem
|
|
|
|
this.selectedForm.rule = this.validation.join(",")
|
|
|
|
this.selectedForm.rule = this.validation.join(",")
|
|
|
|
|
|
|
|
// 字段标识不能重复
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 下拉选项
|
|
|
|
if (this.selectedForm.edit_input === 'radio' || this.selectedForm.edit_input === 'checkbox') {
|
|
|
|
if (this.selectedForm.edit_input === 'radio' || this.selectedForm.edit_input === 'checkbox') {
|
|
|
|
if (this.selectedForm.select_item.length === 0) {
|
|
|
|
if (this.selectedForm.select_item.length === 0) {
|
|
|
|
this.$Message.warning("请输入下拉框选项")
|
|
|
|
this.$Message.warning("请输入下拉框选项")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
// 下拉框选项值不能为空
|
|
|
|
|
|
|
|
let count = 0
|
|
|
|
|
|
|
|
this.selectedForm.select_item.map(item=>{
|
|
|
|
|
|
|
|
if(this.base.isNull(item.value) || this.base.isNull(item.key)){
|
|
|
|
|
|
|
|
count++
|
|
|
|
|
|
|
|
// item.value = item.key
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if(count>0){
|
|
|
|
|
|
|
|
this.$Message.warning("下拉框选项键值不能为空")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// return
|
|
|
|
// return
|
|
|
|
@ -195,16 +220,11 @@
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
selectedForm(newVal) {
|
|
|
|
selectedForm(newVal) {
|
|
|
|
console.log("newval", newVal)
|
|
|
|
console.log("newval", newVal)
|
|
|
|
|
|
|
|
|
|
|
|
if (newVal) {
|
|
|
|
if (newVal) {
|
|
|
|
if (newVal.select_item) {
|
|
|
|
if (newVal.select_item) {
|
|
|
|
this.selectItem = [];
|
|
|
|
this.selectItem = [];
|
|
|
|
this.selectItem = newVal.select_item
|
|
|
|
this.selectItem = newVal.select_item
|
|
|
|
// for(let key in newVal.select_item) {
|
|
|
|
|
|
|
|
// this.selectItem.push({
|
|
|
|
|
|
|
|
// key,
|
|
|
|
|
|
|
|
// value: newVal.select_item[key]
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.validation = []
|
|
|
|
this.validation = []
|
|
|
|
if (newVal.rule) {
|
|
|
|
if (newVal.rule) {
|
|
|
|
|