提交 9d1e41b1 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 过滤组件弹框回显问题

上级 e5bb1e08
...@@ -535,8 +535,10 @@ export default { ...@@ -535,8 +535,10 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
editDialog() { editDialog() {
const serviceName = this.curComponent.serviceName if (this.curComponent && this.curComponent.serviceName) {
this.currentWidget = ApplicationContext.getService(serviceName) const serviceName = this.curComponent.serviceName
this.currentWidget = ApplicationContext.getService(serviceName)
}
this.currentFilterCom = this.curComponent this.currentFilterCom = this.curComponent
this.openFilterDialog() this.openFilterDialog()
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" class="de-dialog-container"> <de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" class="de-dialog-container">
<de-aside-container :show-drag-bar="false" class="ms-aside-container"> <de-aside-container :show-drag-bar="false" class="ms-aside-container">
<el-tabs v-model="activeName" class="filter-dialog-tabs"> <el-tabs v-model="activeName" class="filter-dialog-tabs">
<el-tab-pane :lazy="true" class="de-tab" :label="$t('panel.select_by_table')" name="dataset"> <el-tab-pane class="de-tab" :label="$t('panel.select_by_table')" name="dataset">
<div class="component-header filter-common"> <div class="component-header filter-common">
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="bread in dataSetBreads" :key="bread.label"> <el-breadcrumb-item v-for="bread in dataSetBreads" :key="bread.label">
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
@start="start1" @start="start1"
> >
<transition-group> <transition-group>
<div v-for="item in fieldDatas.filter(item => !keyWord || (item.name && item.name.toLocaleLowerCase().includes(keyWord)))" :key="item.id" class="filter-db-row"> <div v-for="item in fieldDatas.filter(item => !keyWord || (item.name && item.name.toLocaleLowerCase().includes(keyWord)))" :key="item.id" :class="componentInfo && componentInfo.options.attrs.fieldId === item.id ? 'filter-db-row-checked' : 'filter-db-row'" class="filter-db-row">
<i class="el-icon-s-data" /> <i class="el-icon-s-data" />
<span> {{ item.name }}</span> <span> {{ item.name }}</span>
</div> </div>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</el-col> </el-col>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :lazy="true" class="de-tab" :label="$t('panel.select_by_module')" name="assembly"> <el-tab-pane class="de-tab" :label="$t('panel.select_by_module')" name="assembly">
<div class="component-header filter-common"> <div class="component-header filter-common">
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="bread in componentSetBreads" :key="bread.label"> <el-breadcrumb-item v-for="bread in componentSetBreads" :key="bread.label">
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
@start="start1" @start="start1"
> >
<transition-group> <transition-group>
<div v-for="item in comFieldDatas.filter(item => !viewKeyWord || item.name.toLocaleLowerCase().includes(viewKeyWord))" :key="item.id" class="filter-db-row"> <div v-for="item in comFieldDatas.filter(item => !viewKeyWord || item.name.toLocaleLowerCase().includes(viewKeyWord))" :key="item.id" :class="componentInfo && componentInfo.options.attrs.fieldId === item.id ? 'filter-db-row-checked' : 'filter-db-row'" class="filter-db-row">
<i class="el-icon-s-data" /> <i class="el-icon-s-data" />
<span> {{ item.name }}</span> <span> {{ item.name }}</span>
</div> </div>
...@@ -318,7 +318,8 @@ export default { ...@@ -318,7 +318,8 @@ export default {
timer: null, timer: null,
expandedArray: [], expandedArray: [],
viewKeyWord: '', viewKeyWord: '',
titlePopovervisible: false titlePopovervisible: false,
fieldsParent: null
} }
}, },
computed: { computed: {
...@@ -344,15 +345,20 @@ export default { ...@@ -344,15 +345,20 @@ export default {
this.componentInfo.options.attrs.datas = this.widget.optionDatas(res.data) this.componentInfo.options.attrs.datas = this.widget.optionDatas(res.data)
this.componentInfo.options.attrs.fieldId = fieldId this.componentInfo.options.attrs.fieldId = fieldId
this.componentInfo.options.attrs.dragItems = values this.componentInfo.options.attrs.dragItems = values
this.componentInfo.options.attrs.activeName = this.activeName
this.componentInfo.options.attrs.fieldsParent = this.fieldsParent
this.$emit('re-fresh-component', this.componentInfo) this.$emit('re-fresh-component', this.componentInfo)
}) })
} else { } else {
this.componentInfo.options.attrs.fieldId = fieldId this.componentInfo.options.attrs.fieldId = fieldId
this.componentInfo.options.attrs.dragItems = values this.componentInfo.options.attrs.dragItems = values
this.componentInfo.options.attrs.activeName = this.activeName
this.componentInfo.options.attrs.fieldsParent = this.fieldsParent
this.$emit('re-fresh-component', this.componentInfo) this.$emit('re-fresh-component', this.componentInfo)
} }
} else if (this.componentInfo && this.componentInfo.options.attrs.fieldId) { } else if (this.componentInfo && this.componentInfo.options.attrs.fieldId) {
this.componentInfo.options.attrs.fieldId = null this.componentInfo.options.attrs.fieldId = null
this.componentInfo.options.attrs.activeName = null
this.$emit('re-fresh-component', this.componentInfo) this.$emit('re-fresh-component', this.componentInfo)
} }
}, },
...@@ -377,10 +383,23 @@ export default { ...@@ -377,10 +383,23 @@ export default {
if (this.componentInfo && this.componentInfo.options.attrs.dragItems) { if (this.componentInfo && this.componentInfo.options.attrs.dragItems) {
this.selectField = this.componentInfo.options.attrs.dragItems this.selectField = this.componentInfo.options.attrs.dragItems
} }
this.initWithField()
this.loadViews() this.loadViews()
}, },
methods: { methods: {
initWithField() {
if (this.componentInfo && this.componentInfo.options.attrs.activeName) {
this.activeName = this.componentInfo.options.attrs.activeName
if (this.componentInfo.options.attrs.fieldsParent) {
this.fieldsParent = this.componentInfo.options.attrs.fieldsParent
this.$nextTick(() => {
this.activeName === 'dataset' && this.showFieldDatas(this.fieldsParent)
this.activeName !== 'dataset' && this.comShowFieldDatas(this.fieldsParent)
})
}
}
},
getTreeData(val) { getTreeData(val) {
if (val) { if (val) {
this.isTreeSearch = true this.isTreeSearch = true
...@@ -559,6 +578,7 @@ export default { ...@@ -559,6 +578,7 @@ export default {
this.showDomType = 'field' this.showDomType = 'field'
this.setTailLink(row) this.setTailLink(row)
this.addTail(row) this.addTail(row)
this.fieldsParent = row
this.loadField(row.id) this.loadField(row.id)
}, },
comShowFieldDatas(row) { comShowFieldDatas(row) {
...@@ -566,6 +586,7 @@ export default { ...@@ -566,6 +586,7 @@ export default {
this.comShowDomType = 'field' this.comShowDomType = 'field'
this.comSetTailLink(row) this.comSetTailLink(row)
this.comAddTail(row) this.comAddTail(row)
this.fieldsParent = row
this.comLoadField(row.tableId) this.comLoadField(row.tableId)
}, },
onMove(e, originalEvent) { onMove(e, originalEvent) {
...@@ -760,15 +781,33 @@ export default { ...@@ -760,15 +781,33 @@ export default {
color: #409EFF; color: #409EFF;
} }
.filter-db-row { .filter-db-row {
:hover {
cursor: pointer;
}
i { i {
color: #409EFF; color: #3685f2;
} }
// background-color: #3685f2; // background-color: #3685f2;
// color: #fff; // color: #fff;
} }
.filter-db-row:hover {
background-color: #f5f7fa !important;
cursor: pointer;
}
.filter-db-row-checked:hover {
background-color: #f5f7fa !important;
color: inherit;
cursor: pointer;
i {
background-color: inherit;
color: #3685f2;
}
}
.filter-db-row-checked {
background-color: #3685f2 !important;
color: #fff;
i {
background-color: #3685f2;
color: #fff;
}
}
.draggable-group { .draggable-group {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论