Commit cc98787f by cwq0219

bug修复

1 parent e363e191
......@@ -5,6 +5,7 @@
ref="popover"
placement="bottom-start"
trigger="click"
v-model="popoverVisible"
:disabled="targetItem.isDisabled"
@show="onShowPopover"
@hide="onHidePopover"
......@@ -15,6 +16,7 @@
highlight-current
default-expand-all
node-key="id"
:expand-on-click-node="isExpand"
:style="`min-width: ${treeWidth}`"
:data="treeData"
:current-node-key="form[targetItem.name]"
......@@ -29,7 +31,7 @@
clearable
:disabled="targetItem.isDisabled"
:style="`width: ${width}px`"
:class="{ 'rotate': showStatus }"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
:placeholder="'请选择' + targetItem.label"
@change="handleClear"
......@@ -44,8 +46,9 @@ export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
showStatus: false,
popoverVisible: false,
treeWidth: 'auto'
}
},
......@@ -108,12 +111,12 @@ export default {
methods: {
// 显示时触发
onShowPopover() {
this.showStatus = true
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.showStatus = false
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
......@@ -122,9 +125,11 @@ export default {
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
......
......@@ -127,7 +127,6 @@ export default {
searchForm: {
functionName: '',
merchantName: '',
ownCus: 1,
menuIds: '',
menuName: '',
ownedCusgroupType: '',
......@@ -148,23 +147,29 @@ export default {
label: '产品',
name: 'productId',
type: 'select',
multiple: true,
// multiple: true,
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'productList',
changeAttr: (value, targetItem) => {
if (value.includes('')) {
this.searchForm[targetItem.name] = !this.oldVal[targetItem.name].includes('') ? targetItem.optionList.map(item => item[targetItem.optionId]) : this.searchForm[targetItem.name].filter(item => item !== '')
} else {
if (this.oldVal[targetItem.name].includes('')) {
this.searchForm[targetItem.name] = []
} else if (value.length === (targetItem.optionList.length - 1)) {
this.searchForm[targetItem.name].push('')
}
}
this.oldVal[targetItem.name] = this.searchForm[targetItem.name]
this.tableSearchForm[targetItem.name] = this.searchForm[targetItem.name].includes('') ? [] : this.searchForm[targetItem.name]
this.searchForm.menuIds = ''
this.searchForm.parentName = ''
value && baseApi.getMenuTree({ productId: value }).then(res => {
this.baseData.searchMenuTreeList = res.data
this.getOptionsList('searchFormData')
})
// if (value.includes('')) {
// this.searchForm[targetItem.name] = !this.oldVal[targetItem.name].includes('') ? targetItem.optionList.map(item => item[targetItem.optionId]) : this.searchForm[targetItem.name].filter(item => item !== '')
// } else {
// if (this.oldVal[targetItem.name].includes('')) {
// this.searchForm[targetItem.name] = []
// } else if (value.length === (targetItem.optionList.length - 1)) {
// this.searchForm[targetItem.name].push('')
// }
// }
// this.oldVal[targetItem.name] = this.searchForm[targetItem.name]
// this.tableSearchForm[targetItem.name] = this.searchForm[targetItem.name].includes('') ? [] : this.searchForm[targetItem.name]
}
}, {
label: '菜单',
......@@ -227,8 +232,8 @@ export default {
label: '所属客户群体',
prop: 'ownedGroupName'
}, {
label: '创建时间',
prop: 'createdTime'
label: '更新时间',
prop: 'updatedTime'
}]
},
// 弹窗
......@@ -402,9 +407,9 @@ export default {
},
mounted() {
baseApi.getMenuTree().then(res => {
this.baseData.searchMenuTreeList = res.data
})
// baseApi.getMenuTree().then(res => {
// this.baseData.searchMenuTreeList = res.data
// })
this.getBaseData().then(res => {
this.getOptionsList('searchFormData')
this.getOptionsList('editFormData', false)
......@@ -462,7 +467,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
params.productId.includes('') && (params.productId = [])
// params.productId.includes('') && (params.productId = [])
const tempParams = this.getSelectInputParams()
params = {
...params,
......
......@@ -183,7 +183,7 @@ export default {
prop: 'productName'
}, {
label: '更新时间',
prop: 'createdTime'
prop: 'updatedTime'
}]
},
// 弹窗
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!