Merge pull request #662 from dataease/pr@dev@feat_panel-linkage-bar

refactor:联动设置出现未匹配的字段时,给提示
This commit is contained in:
王嘉豪 2021-08-18 17:15:23 +08:00 committed by GitHub
commit 475e6059e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 92 additions and 50 deletions

View File

@ -3,6 +3,7 @@
<el-popover <el-popover
width="400" width="400"
trigger="click" trigger="click"
style="max-height: 400px;overflow-y: auto"
> >
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
@ -13,6 +14,8 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row style="height: 120px;overflow-y: auto">
<el-row v-for="(item, index) in linkageInfo.linkageFields" :key="index"> <el-row v-for="(item, index) in linkageInfo.linkageFields" :key="index">
<el-col :span="11"> <el-col :span="11">
<div class="select-filed"> <div class="select-filed">
@ -60,6 +63,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-row>
<el-row class="bottom"> <el-row class="bottom">
<el-button size="mini" type="success" icon="el-icon-plus" round @click="addLinkageField">追加联动依赖字段</el-button> <el-button size="mini" type="success" icon="el-icon-plus" round @click="addLinkageField">追加联动依赖字段</el-button>
@ -67,7 +71,6 @@
<!-- <el-button slot="reference">T</el-button>--> <!-- <el-button slot="reference">T</el-button>-->
<i slot="reference" class="icon iconfont icon-edit slot-class" /> <i slot="reference" class="icon iconfont icon-edit slot-class" />
</el-popover> </el-popover>
</template> </template>
@ -183,5 +186,9 @@ export default {
height: 35px; height: 35px;
border-radius: 3px; border-radius: 3px;
} }
>>>.el-popover{
height: 200px;
overflow: auto;
}
</style> </style>

View File

@ -320,6 +320,38 @@ export default {
this.close() this.close()
}, },
saveLinkage() { saveLinkage() {
//
// let checkCount = 0
for (const key in this.targetLinkageInfo) {
let subCheckCount = 0
const linkageInfo = this.targetLinkageInfo[key]
const linkageFields = linkageInfo['linkageFields']
if (linkageFields) {
linkageFields.forEach(function(linkage) {
if (!(linkage.sourceField && linkage.targetField)) {
subCheckCount++
}
})
}
if (subCheckCount > 0) {
this.$message({
message: this.$t('chart.datalist') + '【' + linkageInfo.targetViewName + '】' + this.$t('panel.exit_un_march_linkage_field'),
type: 'error',
showClose: true
})
return
}
}
// if (checkCount > 0) {
// this.$message({
// message: this.$t('panel.exit_un_march_linkage_field'),
// type: 'error',
// showClose: true
// })
// return
// }
const request = { const request = {
panelId: this.$store.state.panel.panelInfo.id, panelId: this.$store.state.panel.panelInfo.id,
sourceViewId: this.curLinkageView.propValue.viewId, sourceViewId: this.curLinkageView.propValue.viewId,

View File

@ -1212,7 +1212,8 @@ export default {
drill: 'drill', drill: 'drill',
linkage: 'linkage', linkage: 'linkage',
cancel_linkage: 'Cancel Linkage', cancel_linkage: 'Cancel Linkage',
remove_all_linkage: 'Remove All Linkage' remove_all_linkage: 'Remove All Linkage',
exit_un_march_linkage_field: 'Exit Un March Linkage Field'
}, },
plugin: { plugin: {
local_install: 'Local installation', local_install: 'Local installation',

View File

@ -1211,7 +1211,8 @@ export default {
drill: '下钻', drill: '下钻',
linkage: '联动', linkage: '联动',
cancel_linkage: '取消联动', cancel_linkage: '取消联动',
remove_all_linkage: '清除所有联动' remove_all_linkage: '清除所有联动',
exit_un_march_linkage_field: '存在未匹配联动关系的字段'
}, },
plugin: { plugin: {
local_install: '本地安裝', local_install: '本地安裝',

View File

@ -1213,7 +1213,8 @@ export default {
drill: '下钻', drill: '下钻',
linkage: '联动', linkage: '联动',
cancel_linkage: '取消联动', cancel_linkage: '取消联动',
remove_all_linkage: '清除所有联动' remove_all_linkage: '清除所有联动',
exit_un_march_linkage_field: '存在未匹配联动关系的字段'
}, },
plugin: { plugin: {
local_install: '本地安装', local_install: '本地安装',