fix: 修复组件右侧配置面板,字段不匹配问题

main
wu.jian2 2 years ago
parent 5e657935de
commit 15a4c00704

@ -174,7 +174,7 @@
clearable
:multiple="setting.multiple"
:placeholder="`请选择${setting.label}`"
@change="changeCustomProps(...arguments, setting.field)"
@change="changeCustomProps(...arguments, index)"
>
<el-option
v-for="(field, fieldIndex) in dataSourceDataList"
@ -618,12 +618,14 @@ export default {
...mapState({
pageInfo: state => state.bigScreen.pageInfo,
config: state => state.bigScreen.activeItemConfig
//
// cacheDataSets: state => state.bigScreen.pageInfo.pageConfig.cacheDataSets
}),
dataSourceDataList () {
return this.fieldsList?.map(item => ({
...item,
comment: item?.comment || item?.name,
name: item?.name
comment: item?.fieldDesc || item?.fieldName,
name: item?.fieldName
}))
},
appCode: {
@ -647,8 +649,8 @@ export default {
return (
list?.map(field => {
return {
label: field.comment,
value: field.name
label: field.fieldDesc,
value: field.fieldName
}
}) || []
)
@ -685,7 +687,6 @@ export default {
if (this.config.dataSource && this.config.dataSource.businessKey) {
this.getDataSetDetailsById(this.config.dataSource.businessKey, 'initial')
}
console.log(this.config)
},
methods: {
//
@ -746,8 +747,8 @@ export default {
this.config.inParams =
this.fieldsList?.map(field => {
return {
name: field.comment, //
code: field.name //
name: field.fieldDesc, //
code: field.fieldName //
}
}) || []
}
@ -795,10 +796,15 @@ export default {
this.config.customize.columnConfig = cloneDeep(this.headerList)
this.$store.commit('bigScreen/changeActiveItemConfig', this.config)
},
changeCustomProps (value, field) {
const index = this.config.setting.findIndex(param => param.field === field)
changeCustomProps (value, index) {
this.$set(this.config.setting[index], 'value', value)
}
// key
// changeCacheBusinessKey (id) {
// // idfields
// this.fieldsList = this.cacheDataSets?.find(cache => cache.dataSetId === id)?.fields
// this.params = this.cacheDataSets?.find(cache => cache.dataSetId === id)?.params
// }
}
}
</script>

@ -139,7 +139,7 @@ export default {
try {
this.$parent.init()
} catch (error) {
this.$parent.initLazyOrgTree()
this.$parent.initLazyDatasetTypeTree()
}
})
} else {
@ -149,7 +149,7 @@ export default {
try {
this.$parent.init()
} catch (error) {
this.$parent.initLazyOrgTree()
this.$parent.initLazyDatasetTypeTree()
}
})
}

@ -51,7 +51,7 @@
</div>
<ul
v-show="!noData"
id="orgTree"
id="datasetTypeTree"
class="ztree"
/>
<div
@ -160,7 +160,7 @@ import 'packages/assets/style/zTree/zTreeSelect.scss'
import { getCategoryTree, categoryRemove } from 'packages/js/utils/datasetConfigService'
import OrgEditForm from './CategroyEditForm.vue'
export default {
name: 'OrgTreeIndex',
name: 'DatasetTypeTreeIndex',
components: {
OrgEditForm
},
@ -223,7 +223,7 @@ export default {
},
computed: { },
mounted () {
this.initLazyOrgTree()
this.initLazyDatasetTypeTree()
},
methods: {
@ -288,14 +288,14 @@ export default {
}
},
//
initLazyOrgTree () {
initLazyDatasetTypeTree () {
this.loading = true
getCategoryTree({ type: 'dataset', moduleCode: this.appCode }).then((res) => {
this.categoryData = res.map((item) => {
return { isParent: item.hasChildren, ...item }
})
this.categoryData.unshift({ name: '全部', id: '', parentId: '0' })
this.ztreeObj = $.fn.zTree.init($('#orgTree'), this.ztreeSetting, this.categoryData)
this.ztreeObj = $.fn.zTree.init($('#datasetTypeTree'), this.ztreeSetting, this.categoryData)
this.$emit('reCategory')
}).then((e) => {
this.loading = false
@ -347,14 +347,14 @@ export default {
reSearch () {
this.activeName = 'group'
if (this.queryForm.searchKey) {
const treeObj = $.fn.zTree.getZTreeObj('orgTree')
const treeObj = $.fn.zTree.getZTreeObj('datasetTypeTree')
const nodes = treeObj.getNodesByParam('isHidden', true)
treeObj.showNodes(nodes)
const hiddenNodes = treeObj.getNodesByFilter(this.filterNode)
treeObj.hideNodes(hiddenNodes)
treeObj.expandAll(true)
} else {
this.initLazyOrgTree()
this.initLazyDatasetTypeTree()
}
},
//
@ -433,7 +433,7 @@ export default {
categoryRemove(org.id).then((data) => {
this.$message.success('操作成功')
// this.ztreeObj.removeNode(org)
this.initLazyOrgTree()
this.initLazyDatasetTypeTree()
//
this.$emit('refreshData', org)
})

Loading…
Cancel
Save