Commit 288c8c8d by xinla

智能表单element render children空数组与省市区加载问题

1 parent e90aaa78
......@@ -70,9 +70,6 @@ export default {
},
},
},
mounted() {
console.log(this.$attrs)
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
......
......@@ -526,9 +526,9 @@
</el-scrollbar>
</div>
<treeNode-dialog v-model:visible="dialogVisible" title="添加选项" @commit="addNode" />
<treeNode-dialog v-model:visible="ifEditor" title="修改选项名" @commit="EditorNode" />
<icons-dialog v-model:visible="iconsVisible" :current="activeData[currentIconModel]" @select="setIcon" />
<treeNode-dialog v-model="dialogVisible" title="添加选项" @commit="addNode" />
<treeNode-dialog v-model="ifEditor" title="修改选项名" @commit="EditorNode" />
<icons-dialog v-model="iconsVisible" :current="activeData[currentIconModel]" @select="setIcon" />
</div>
</template>
......@@ -789,11 +789,11 @@ export default {
addNode(data) {
this.currentNode.push(data)
console.log('this.currentNode', this.currentNode)
// console.log('this.currentNode', this.currentNode)
},
EditorNode(data) {
console.log('currentNode', this.currentNode)
console.log('data', data)
// console.log('currentNode', this.currentNode)
// console.log('data', data)
this.currentNode.label = data.label
this.currentNode.value = data.value
},
......
......@@ -115,7 +115,7 @@ export default {
},
onClose() {},
close() {
this.$emit('update:visible', false)
this.$emit('update:model-value', false)
},
handelConfirm() {
this.$refs.elForm.validate((valid) => {
......
......@@ -240,10 +240,11 @@ export const inputComponents = [
labelWidth: null,
style: { width: '100%' },
ssq: '',
// props: {
// value: 'id',
// label: 'name',
// },
options: [],
props: {
value: 'id',
label: 'name',
},
'show-all-levels': true,
disabled: false,
clearable: true,
......
......@@ -145,33 +145,8 @@ const componentChild = {
export default {
props: ['conf'],
data() {
return {props:{
value: 'id',
label: 'name',
lazy: true,
lazyLoad(node, resolve) {
debugger
if (node.level == 0) {
getProvinceCityTree().then((data) => {
resolve(data)
})
} else {
if (node.level == 2) {
node.data.children.forEach((e) => (e.leaf = true))
}
resolve([])
}
},
}}
},
render() {
const dataObject = {
// attrs: {},
// props: {},
// on: {},
// style: {},
}
const dataObject = {}
const confClone = JSON.parse(JSON.stringify(this.conf))
const children = []
......@@ -201,14 +176,13 @@ export default {
// }
// })
debugger
// 配置省市区数据首次懒加载
if (confClone.formCodeId == 9) {
debugger
dataObject.props = this.props
// 配置省市区数据首次加载
if (confClone.formCodeId == 9 && !this.conf.options?.length) {
getProvinceCityTree().then((data) => {
this.conf.options= data
})
}
return h(resolveComponent(this.conf.tag), dataObject, children)
return h(resolveComponent(this.conf.tag), dataObject, children?.length ? children : undefined)
},
}
......@@ -412,7 +412,6 @@ export default {
this.activeFormItem(clone)
},
cloneComponent(origin) {
debugger
const clone = JSON.parse(JSON.stringify(origin))
clone.formId = this.idGlobal = uuid()
clone.span = formConf.span
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!