forked from github/dataease
refactor(仪表板、数据大屏): 支持富文本清理数据集
This commit is contained in:
parent
52aab97ecd
commit
7e08124f77
@ -10,6 +10,8 @@ import { ElFormItem, FormInstance } from 'element-plus-secondary'
|
|||||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||||
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
|
|
||||||
const { wsCache } = useCache('localStorage')
|
const { wsCache } = useCache('localStorage')
|
||||||
const userStore = useUserStoreWithOut()
|
const userStore = useUserStoreWithOut()
|
||||||
@ -200,6 +202,20 @@ function onPopoverHide() {
|
|||||||
function getNode(nodeId: number) {
|
function getNode(nodeId: number) {
|
||||||
return datasetSelector?.value?.getNode(nodeId)
|
return datasetSelector?.value?.getNode(nodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clearShow = computed(
|
||||||
|
() =>
|
||||||
|
props.sourceType === 'dataset' &&
|
||||||
|
dvMainStore.curComponent &&
|
||||||
|
dvMainStore.curComponent.innerType === 'rich-text'
|
||||||
|
)
|
||||||
|
|
||||||
|
const handleClear = e => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
dsClick({ leaf: true, id: null } as Tree)
|
||||||
|
}
|
||||||
|
|
||||||
const handleFocus = () => {
|
const handleFocus = () => {
|
||||||
if (
|
if (
|
||||||
props.sourceType === 'dataset' &&
|
props.sourceType === 'dataset' &&
|
||||||
@ -246,7 +262,6 @@ onMounted(() => {
|
|||||||
size="middle"
|
size="middle"
|
||||||
:effect="themes"
|
:effect="themes"
|
||||||
v-model="selectedNodeName"
|
v-model="selectedNodeName"
|
||||||
readonly
|
|
||||||
class="data-set-dark"
|
class="data-set-dark"
|
||||||
@focus="handleFocus"
|
@focus="handleFocus"
|
||||||
:placeholder="'请选择' + sourceName"
|
:placeholder="'请选择' + sourceName"
|
||||||
@ -255,6 +270,9 @@ onMounted(() => {
|
|||||||
<el-icon class="input-arrow-icon" :class="{ reverse: _popoverShow }">
|
<el-icon class="input-arrow-icon" :class="{ reverse: _popoverShow }">
|
||||||
<ArrowDown />
|
<ArrowDown />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
<el-icon v-if="clearShow" class="input-custom-clear-icon" @click="handleClear">
|
||||||
|
<CircleClose />
|
||||||
|
</el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -367,6 +385,9 @@ onMounted(() => {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
.input-custom-clear-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
.input-arrow-icon {
|
.input-arrow-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
transform: rotateZ(0);
|
transform: rotateZ(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user