Merge pull request #12207 from dataease/pr@dev-v2@revert-picture

revert: 回退部分代码
This commit is contained in:
王嘉豪 2024-09-13 17:32:01 +08:00 committed by GitHub
commit a7add09991
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 118 deletions

View File

@ -28,8 +28,8 @@ const props = defineProps({
})
const { dvModel } = toRefs(props)
const newComponent = (componentName, innerType) => {
eventBus.emit('handleNew', { componentName: componentName, innerType: innerType })
const newComponent = params => {
eventBus.emit('handleNew', { componentName: params, innerType: params })
}
const handleDragStart = e => {
@ -47,22 +47,22 @@ const handleDragEnd = e => {
:themes="themes"
icon="dv-picture-show"
label="图片"
drag-info="UserView&Picture"
v-on:click="newComponent('UserView', 'Picture')"
drag-info="Picture&Picture"
v-on:click="newComponent('Picture')"
></drag-component>
<drag-component
:themes="themes"
icon="icon-video"
label="视频"
drag-info="DeVideo&DeVideo"
v-on:click="newComponent('DeVideo', 'DeVideo')"
v-on:click="newComponent('DeVideo')"
></drag-component>
<drag-component
:themes="themes"
icon="icon-stream"
label="流媒体"
drag-info="DeStreamMedia&DeStreamMedia"
v-on:click="newComponent('DeStreamMedia', 'DeStreamMedia')"
v-on:click="newComponent('DeStreamMedia')"
></drag-component>
</div>
</template>

View File

@ -306,18 +306,7 @@ const list = [
component: 'UserView',
name: '图表',
label: '图表',
propValue: {
textValue: '',
url: '',
pictureAttr: {
showType: 'common', // 图片显示方式 common 正常显示 dataset 绑定数据集显示
dsConditionShowType: 'show' // dataset条件满足时显示方式 show显示 hidden 隐藏
},
flip: {
horizontal: false,
vertical: false
}
},
propValue: { textValue: '' },
icon: 'bar',
innerType: 'bar',
editing: false,
@ -610,9 +599,6 @@ export function findNewComponentFromList(
if (comp.component === 'DeTabs') {
newComponent.propValue[0].name = guid()
}
if (newComponent.innerType === 'Picture') {
newComponent.style['adaptation'] = 'adaptation'
}
}
})

View File

@ -27,7 +27,7 @@ const props = defineProps({
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const { curComponent, canvasViewInfo } = storeToRefs(dvMainStore)
const { curComponent } = storeToRefs(dvMainStore)
const fileList = ref([])
const dialogImageUrl = ref('')
@ -39,20 +39,6 @@ const datasetSelector = ref(null)
const filterTree = ref(null)
const state = reactive({})
const addDsWindow = () => {
// do addDs
}
const doUpdate = () => {
// do update
}
const view = computed(() =>
curComponent.value ? canvasViewInfo.value[curComponent.value.id] : null
)
const dsSelectedShow = computed(
() => curComponent.value.propValue?.pictureAttr?.showType === 'dataset' && view.value
)
const handlePictureCardPreview = file => {
dialogImageUrl.value = file.url
dialogVisible.value = true
@ -103,26 +89,10 @@ const init = () => {
}
}
const openTreeFilter = () => {
filterTree.value.init(cloneDeep(view.value.customFilter))
}
const isFilterActive = computed(() => {
return !!view.value?.customFilter?.items?.length
})
const changeFilterData = customFilter => {
view.value.customFilter = cloneDeep(customFilter)
}
const toolTip = computed(() => {
return props.themes === 'dark' ? 'ndark' : 'dark'
})
const removeCustomFilter = () => {
view.value.customFilter = {}
}
watch(
() => curComponent.value.propValue.url,
() => {
@ -222,69 +192,6 @@ onBeforeUnmount(() => {
</el-radio-group>
</el-form-item>
</el-row>
<template v-if="curComponent?.propValue?.pictureAttr?.showType">
<el-row class="pic-adaptor" v-if="curComponent.propValue?.pictureAttr?.showType">
<el-form-item
class="form-item"
label="图片显示"
size="small"
:effect="themes"
:class="'form-item-' + themes"
>
<el-radio-group
size="small"
v-model="curComponent.propValue.pictureAttr.showType"
@change="onStyleChange"
:effect="themes"
>
<el-radio label="common" :effect="themes">显示</el-radio>
<el-radio label="dataset" :effect="themes">绑定数据集</el-radio>
</el-radio-group>
</el-form-item>
</el-row>
<el-row class="pic-adaptor" v-if="dsSelectedShow">
<dataset-select
ref="datasetSelector"
v-model="view.tableId"
style="flex: 1"
:view-id="view.id"
:state-obj="state"
:themes="themes"
@add-ds-window="addDsWindow"
@on-dataset-change="doUpdate"
/>
</el-row>
<el-row class="padding-lr drag-data no-top-border no-top-padding">
<div class="form-draggable-title">
<span>
{{ t('chart.result_filter') }}
</span>
<el-tooltip :effect="toolTip" placement="top" :content="t('common.delete')">
<el-icon
class="remove-icon"
:class="{ 'remove-icon--dark': themes === 'dark' }"
size="14px"
@click="removeCustomFilter"
>
<Icon class-name="inner-class" name="icon_delete-trash_outlined" />
</el-icon>
</el-tooltip>
</div>
<div
class="tree-btn"
:class="{ 'tree-btn--dark': themes === 'dark', active: isFilterActive }"
@click="openTreeFilter"
>
<el-icon>
<Icon class="svg-background" name="icon-filter"></Icon>
</el-icon>
<span>{{ $t('chart.filter') }}</span>
</div>
</el-row>
<FilterTree ref="filterTree" @filter-data="changeFilterData" />
</template>
</el-collapse-item>
</CommonAttr>
</div>

View File

@ -61,9 +61,6 @@ export function findNewComponent(componentName, innerType, staticMap?) {
textValue: ''
}
}
if (newComponent.innerType === 'Picture') {
newComponent.style['adaptation'] = 'adaptation'
}
if (dvMainStore.curOriginThemes === 'light') {
newComponent['commonBackground'] = cloneDeep(COMMON_COMPONENT_BACKGROUND_LIGHT)
} else {