diff --git a/jero-web/src/components/jero/JTreeDict.vue b/jero-web/src/components/jero/JTreeDict.vue index faa4bcae..7d5a4b9c 100644 --- a/jero-web/src/components/jero/JTreeDict.vue +++ b/jero-web/src/components/jero/JTreeDict.vue @@ -90,13 +90,10 @@ export default { }, computed: { _attrs () { - let attrs - attrs = { ...this.$attrs } - return attrs + return { ...this.$attrs } }, // 透传给下级组件的事件,需要排除本组件使用的change事件 childListeners () { - const vm = this const result = Object.assign({}, this.$listeners ) @@ -114,7 +111,7 @@ export default { }, methods: { loadViewInfo () { - if (!this.value || this.value == '0') { + if (!this.value || this.value + '' === '0') { this.treeValue = null } else { const param = { @@ -172,8 +169,8 @@ export default { addChildren (pid, children, treeArray) { if (treeArray && treeArray.length > 0) { for (const item of treeArray) { - if (item.key == pid) { - if (!children || children.length == 0) { + if (item.key + '' === pid + '') { + if (!children || children.length === 0) { item.leaf = true } else { item.children = children @@ -186,7 +183,7 @@ export default { } }, handleTreeNodeValue (result) { - const storeField = this.field == 'code' ? 'code' : 'key' + const storeField = this.field + '' === 'code' ? 'code' : 'key' for (const i of result) { i.value = i[storeField] i.isLeaf = !(!i.leaf)