forked from github/dataease
Merge pull request #12207 from dataease/pr@dev-v2@revert-picture
revert: 回退部分代码
This commit is contained in:
commit
a7add09991
@ -28,8 +28,8 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const { dvModel } = toRefs(props)
|
const { dvModel } = toRefs(props)
|
||||||
const newComponent = (componentName, innerType) => {
|
const newComponent = params => {
|
||||||
eventBus.emit('handleNew', { componentName: componentName, innerType: innerType })
|
eventBus.emit('handleNew', { componentName: params, innerType: params })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDragStart = e => {
|
const handleDragStart = e => {
|
||||||
@ -47,22 +47,22 @@ const handleDragEnd = e => {
|
|||||||
:themes="themes"
|
:themes="themes"
|
||||||
icon="dv-picture-show"
|
icon="dv-picture-show"
|
||||||
label="图片"
|
label="图片"
|
||||||
drag-info="UserView&Picture"
|
drag-info="Picture&Picture"
|
||||||
v-on:click="newComponent('UserView', 'Picture')"
|
v-on:click="newComponent('Picture')"
|
||||||
></drag-component>
|
></drag-component>
|
||||||
<drag-component
|
<drag-component
|
||||||
:themes="themes"
|
:themes="themes"
|
||||||
icon="icon-video"
|
icon="icon-video"
|
||||||
label="视频"
|
label="视频"
|
||||||
drag-info="DeVideo&DeVideo"
|
drag-info="DeVideo&DeVideo"
|
||||||
v-on:click="newComponent('DeVideo', 'DeVideo')"
|
v-on:click="newComponent('DeVideo')"
|
||||||
></drag-component>
|
></drag-component>
|
||||||
<drag-component
|
<drag-component
|
||||||
:themes="themes"
|
:themes="themes"
|
||||||
icon="icon-stream"
|
icon="icon-stream"
|
||||||
label="流媒体"
|
label="流媒体"
|
||||||
drag-info="DeStreamMedia&DeStreamMedia"
|
drag-info="DeStreamMedia&DeStreamMedia"
|
||||||
v-on:click="newComponent('DeStreamMedia', 'DeStreamMedia')"
|
v-on:click="newComponent('DeStreamMedia')"
|
||||||
></drag-component>
|
></drag-component>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -306,18 +306,7 @@ const list = [
|
|||||||
component: 'UserView',
|
component: 'UserView',
|
||||||
name: '图表',
|
name: '图表',
|
||||||
label: '图表',
|
label: '图表',
|
||||||
propValue: {
|
propValue: { textValue: '' },
|
||||||
textValue: '',
|
|
||||||
url: '',
|
|
||||||
pictureAttr: {
|
|
||||||
showType: 'common', // 图片显示方式 common 正常显示 dataset 绑定数据集显示
|
|
||||||
dsConditionShowType: 'show' // dataset条件满足时显示方式 show显示 hidden 隐藏
|
|
||||||
},
|
|
||||||
flip: {
|
|
||||||
horizontal: false,
|
|
||||||
vertical: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: 'bar',
|
icon: 'bar',
|
||||||
innerType: 'bar',
|
innerType: 'bar',
|
||||||
editing: false,
|
editing: false,
|
||||||
@ -610,9 +599,6 @@ export function findNewComponentFromList(
|
|||||||
if (comp.component === 'DeTabs') {
|
if (comp.component === 'DeTabs') {
|
||||||
newComponent.propValue[0].name = guid()
|
newComponent.propValue[0].name = guid()
|
||||||
}
|
}
|
||||||
if (newComponent.innerType === 'Picture') {
|
|
||||||
newComponent.style['adaptation'] = 'adaptation'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ const props = defineProps({
|
|||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const snapshotStore = snapshotStoreWithOut()
|
const snapshotStore = snapshotStoreWithOut()
|
||||||
|
|
||||||
const { curComponent, canvasViewInfo } = storeToRefs(dvMainStore)
|
const { curComponent } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
const dialogImageUrl = ref('')
|
const dialogImageUrl = ref('')
|
||||||
@ -39,20 +39,6 @@ const datasetSelector = ref(null)
|
|||||||
const filterTree = ref(null)
|
const filterTree = ref(null)
|
||||||
const state = reactive({})
|
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 => {
|
const handlePictureCardPreview = file => {
|
||||||
dialogImageUrl.value = file.url
|
dialogImageUrl.value = file.url
|
||||||
dialogVisible.value = true
|
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(() => {
|
const toolTip = computed(() => {
|
||||||
return props.themes === 'dark' ? 'ndark' : 'dark'
|
return props.themes === 'dark' ? 'ndark' : 'dark'
|
||||||
})
|
})
|
||||||
|
|
||||||
const removeCustomFilter = () => {
|
|
||||||
view.value.customFilter = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => curComponent.value.propValue.url,
|
() => curComponent.value.propValue.url,
|
||||||
() => {
|
() => {
|
||||||
@ -222,69 +192,6 @@ onBeforeUnmount(() => {
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</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>
|
</el-collapse-item>
|
||||||
</CommonAttr>
|
</CommonAttr>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,9 +61,6 @@ export function findNewComponent(componentName, innerType, staticMap?) {
|
|||||||
textValue: ''
|
textValue: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newComponent.innerType === 'Picture') {
|
|
||||||
newComponent.style['adaptation'] = 'adaptation'
|
|
||||||
}
|
|
||||||
if (dvMainStore.curOriginThemes === 'light') {
|
if (dvMainStore.curOriginThemes === 'light') {
|
||||||
newComponent['commonBackground'] = cloneDeep(COMMON_COMPONENT_BACKGROUND_LIGHT)
|
newComponent['commonBackground'] = cloneDeep(COMMON_COMPONENT_BACKGROUND_LIGHT)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user