forked from github/dataease
fix(数据集): 数据集查询优化
This commit is contained in:
parent
959d7f5e5f
commit
3c5262d14b
12
core/core-frontend/src/assets/svg/icon_warning_colorful.svg
Normal file
12
core/core-frontend/src/assets/svg/icon_warning_colorful.svg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_1052_111876)">
|
||||||
|
<path d="M8.00033 15.3332C12.0504 15.3332 15.3337 12.0499 15.3337 7.99984C15.3337 3.94975 12.0504 0.666504 8.00033 0.666504C3.95024 0.666504 0.666992 3.94975 0.666992 7.99984C0.666992 12.0499 3.95024 15.3332 8.00033 15.3332Z" fill="#FF8800"/>
|
||||||
|
<path d="M7.66634 4.6665C7.48225 4.6665 7.33301 4.81574 7.33301 4.99984V8.99984C7.33301 9.18393 7.48225 9.33317 7.66634 9.33317H8.33301C8.5171 9.33317 8.66634 9.18393 8.66634 8.99984V4.99984C8.66634 4.81574 8.5171 4.6665 8.33301 4.6665H7.66634Z" fill="white"/>
|
||||||
|
<path d="M7.66634 9.99984C7.48225 9.99984 7.33301 10.1491 7.33301 10.3332V10.9998C7.33301 11.1839 7.48225 11.3332 7.66634 11.3332H8.33301C8.5171 11.3332 8.66634 11.1839 8.66634 10.9998V10.3332C8.66634 10.1491 8.5171 9.99984 8.33301 9.99984H7.66634Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_1052_111876">
|
||||||
|
<rect width="16" height="16" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1022 B |
@ -1656,7 +1656,10 @@ defineExpose({
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-item" v-if="+curComponent.displayType === 0">
|
<div
|
||||||
|
class="list-item"
|
||||||
|
v-if="+curComponent.displayType === 0 && curComponent.optionValueSource !== 1"
|
||||||
|
>
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="dark"
|
effect="dark"
|
||||||
|
@ -192,7 +192,6 @@ const handleFieldIdChange = (val: EnumValue) => {
|
|||||||
? [...selectValue.value]
|
? [...selectValue.value]
|
||||||
: selectValue.value
|
: selectValue.value
|
||||||
}
|
}
|
||||||
setEmptyData()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +210,8 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const setEmptyData = () => {
|
const setEmptyData = () => {
|
||||||
const { showEmpty, displayType } = config.value
|
const { showEmpty, displayType, optionValueSource } = config.value
|
||||||
if (+displayType !== 0) return
|
if (+displayType !== 0 || optionValueSource === 1) return
|
||||||
const [s] = options.value
|
const [s] = options.value
|
||||||
if (showEmpty) {
|
if (showEmpty) {
|
||||||
if (s?.value !== '_empty_$') {
|
if (s?.value !== '_empty_$') {
|
||||||
|
@ -108,6 +108,23 @@ const dfsNodeNameList = (list, arr) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dfsForDsId = (arr, datasourceId) => {
|
||||||
|
return arr.every(ele => {
|
||||||
|
if (arr.children?.length) {
|
||||||
|
return dfsForDsId(arr.children, datasourceId)
|
||||||
|
}
|
||||||
|
return ele.datasourceId === datasourceId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const crossDatasources = computed(() => {
|
||||||
|
const { datasourceId, children = [] } = state.nodeList[0] || {}
|
||||||
|
if (datasourceId && !!children.length) {
|
||||||
|
return dfsForDsId(children, datasourceId)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
let isUpdate = false
|
let isUpdate = false
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@ -838,7 +855,8 @@ defineExpose({
|
|||||||
notConfirm,
|
notConfirm,
|
||||||
dfsNodeFieldBack,
|
dfsNodeFieldBack,
|
||||||
initState,
|
initState,
|
||||||
setChangeStatus
|
setChangeStatus,
|
||||||
|
crossDatasources
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleActiveNode = ele => {
|
const handleActiveNode = ele => {
|
||||||
|
@ -815,6 +815,10 @@ const mouseupDrag = () => {
|
|||||||
dom.removeEventListener('mousemove', calculateWidth)
|
dom.removeEventListener('mousemove', calculateWidth)
|
||||||
dom.removeEventListener('mousemove', calculateHeight)
|
dom.removeEventListener('mousemove', calculateHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const crossDatasources = computed(() => {
|
||||||
|
return datasetDrag.value?.crossDatasources
|
||||||
|
})
|
||||||
const calculateWidth = (e: MouseEvent) => {
|
const calculateWidth = (e: MouseEvent) => {
|
||||||
if (e.pageX < 240) {
|
if (e.pageX < 240) {
|
||||||
LeftWidth.value = 240
|
LeftWidth.value = 240
|
||||||
@ -1328,6 +1332,12 @@ const getDsIconName = data => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="drag-right" :style="{ width: `calc(100vw - ${showLeft ? LeftWidth : 0}px)` }">
|
<div class="drag-right" :style="{ width: `calc(100vw - ${showLeft ? LeftWidth : 0}px)` }">
|
||||||
|
<div v-if="crossDatasources" class="different-datasource">
|
||||||
|
<el-icon>
|
||||||
|
<Icon name="icon_warning_colorful"></Icon>
|
||||||
|
</el-icon>
|
||||||
|
您正在进行跨数据源的表关联,请确保使用calcite的标准语法和函数,否则会导致数据集报错
|
||||||
|
</div>
|
||||||
<dataset-union
|
<dataset-union
|
||||||
@join-editor="joinEditor"
|
@join-editor="joinEditor"
|
||||||
@changeUpdate="changeUpdate"
|
@changeUpdate="changeUpdate"
|
||||||
@ -1343,7 +1353,9 @@ const getDsIconName = data => {
|
|||||||
<div
|
<div
|
||||||
class="sql-result"
|
class="sql-result"
|
||||||
:style="{
|
:style="{
|
||||||
height: sqlResultHeight ? `${sqlResultHeight}px` : `calc(100% - ${dragHeight}px)`
|
height: sqlResultHeight
|
||||||
|
? `${crossDatasources ? sqlResultHeight - 40 : sqlResultHeight}px`
|
||||||
|
: `calc(100% - ${crossDatasources ? dragHeight + 40 : dragHeight}px)`
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="sql-title">
|
<div class="sql-title">
|
||||||
@ -2101,6 +2113,23 @@ const getDsIconName = data => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
.drag-right {
|
.drag-right {
|
||||||
height: calc(100vh - 56px);
|
height: calc(100vh - 56px);
|
||||||
|
.different-datasource {
|
||||||
|
height: 40px;
|
||||||
|
width: 100%;
|
||||||
|
background: #ffe7cc;
|
||||||
|
color: #1f2329;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px;
|
||||||
|
|
||||||
|
.ed-icon {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.sql-result {
|
.sql-result {
|
||||||
font-family: '阿里巴巴普惠体 3.0 55 Regular L3';
|
font-family: '阿里巴巴普惠体 3.0 55 Regular L3';
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
Loading…
Reference in New Issue
Block a user