【fix ESLint】src/components/jero/JTreeDict

This commit is contained in:
zhaoxiao
2023-03-06 09:21:02 +08:00
parent 0d421fbc85
commit 4c3d2079ce
+5 -8
View File
@@ -90,13 +90,10 @@ export default {
}, },
computed: { computed: {
_attrs () { _attrs () {
let attrs return { ...this.$attrs }
attrs = { ...this.$attrs }
return attrs
}, },
// 透传给下级组件的事件,需要排除本组件使用的change事件 // 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () { childListeners () {
const vm = this
const result = Object.assign({}, const result = Object.assign({},
this.$listeners this.$listeners
) )
@@ -114,7 +111,7 @@ export default {
}, },
methods: { methods: {
loadViewInfo () { loadViewInfo () {
if (!this.value || this.value == '0') { if (!this.value || this.value + '' === '0') {
this.treeValue = null this.treeValue = null
} else { } else {
const param = { const param = {
@@ -172,8 +169,8 @@ export default {
addChildren (pid, children, treeArray) { addChildren (pid, children, treeArray) {
if (treeArray && treeArray.length > 0) { if (treeArray && treeArray.length > 0) {
for (const item of treeArray) { for (const item of treeArray) {
if (item.key == pid) { if (item.key + '' === pid + '') {
if (!children || children.length == 0) { if (!children || children.length === 0) {
item.leaf = true item.leaf = true
} else { } else {
item.children = children item.children = children
@@ -186,7 +183,7 @@ export default {
} }
}, },
handleTreeNodeValue (result) { handleTreeNodeValue (result) {
const storeField = this.field == 'code' ? 'code' : 'key' const storeField = this.field + '' === 'code' ? 'code' : 'key'
for (const i of result) { for (const i of result) {
i.value = i[storeField] i.value = i[storeField]
i.isLeaf = !(!i.leaf) i.isLeaf = !(!i.leaf)