提交 732cb32a authored 作者: wangjiahao's avatar wangjiahao

refactor: 过滤组件可以跟随仪表板缩放

上级 0a16c911
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
:out-style="config.style" :out-style="config.style"
:element="config" :element="config"
:in-screen="inScreen" :in-screen="inScreen"
:h="config.style.height"
/> />
<component <component
:is="config.component" :is="config.component"
......
...@@ -37,6 +37,17 @@ ...@@ -37,6 +37,17 @@
</span> </span>
<UserViewDialog ref="userViewDialog" :chart="showChartInfo" :chart-table="showChartTableInfo" /> <UserViewDialog ref="userViewDialog" :chart="showChartInfo" :chart-table="showChartTableInfo" />
</el-dialog> </el-dialog>
<!--手机视图详情-->
<el-dialog
:title="'['+showChartInfo.name+']'+$t('chart.chart_details')"
:visible.sync="mobileChartDetailsVisible"
:fullscreen="true"
class="mobile-dialog-css"
:destroy-on-close="true"
>
<UserViewMobileDialog :chart="showChartInfo" :chart-table="showChartTableInfo" />
</el-dialog>
</div> </div>
</div> </div>
</div> </div>
...@@ -53,9 +64,10 @@ import eventBus from '@/components/canvas/utils/eventBus' ...@@ -53,9 +64,10 @@ import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector' import elementResizeDetectorMaker from 'element-resize-detector'
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar' import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
import UserViewMobileDialog from '@/components/canvas/custom-component/UserViewMobileDialog'
export default { export default {
components: { ComponentWrapper, UserViewDialog, CanvasOptBar }, components: { UserViewMobileDialog, ComponentWrapper, UserViewDialog, CanvasOptBar },
model: { model: {
prop: 'show', prop: 'show',
event: 'change' event: 'change'
...@@ -103,6 +115,7 @@ export default { ...@@ -103,6 +115,7 @@ export default {
mainHeight: '100%', mainHeight: '100%',
searchCount: 0, searchCount: 0,
chartDetailsVisible: false, chartDetailsVisible: false,
mobileChartDetailsVisible: false,
showChartInfo: {}, showChartInfo: {},
showChartTableInfo: {}, showChartTableInfo: {},
// 布局展示 1.pc pc端布局 2.mobile 移动端布局 // 布局展示 1.pc pc端布局 2.mobile 移动端布局
...@@ -249,7 +262,11 @@ export default { ...@@ -249,7 +262,11 @@ export default {
openChartDetailsDialog(chartInfo) { openChartDetailsDialog(chartInfo) {
this.showChartInfo = chartInfo.chart this.showChartInfo = chartInfo.chart
this.showChartTableInfo = chartInfo.tableChart this.showChartTableInfo = chartInfo.tableChart
if (this.terminal === 'pc') {
this.chartDetailsVisible = true this.chartDetailsVisible = true
} else {
this.mobileChartDetailsVisible
}
}, },
exportExcel() { exportExcel() {
this.$refs['userViewDialog'].exportExcel() this.$refs['userViewDialog'].exportExcel()
...@@ -309,6 +326,9 @@ export default { ...@@ -309,6 +326,9 @@ export default {
padding: 10px 20px 20px; padding: 10px 20px 20px;
} }
.mobile-dialog-css > > > .el-dialog__body {
padding: 0px;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0px!important; width: 0px!important;
height: 0px!important; height: 0px!important;
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
:element="item" :element="item"
:out-style="getShapeStyleInt(item.style)" :out-style="getShapeStyleInt(item.style)"
:active="item === curComponent" :active="item === curComponent"
:h="getShapeStyleIntDeDrag(item.style,'height')"
/> />
<component <component
:is="item.component" :is="item.component"
...@@ -1567,7 +1568,6 @@ export default { ...@@ -1567,7 +1568,6 @@ export default {
padding:3px; padding:3px;
} }
.ref-line { .ref-line {
position: absolute; position: absolute;
background-color: #70c0ff;; background-color: #70c0ff;;
......
<template> <template>
<de-container> <de-container>
<de-main-container v-if="!chart.type.includes('table')" :style="customStyle"> <de-main-container v-if="!chart.type.includes('table')" :style="customStyle" class="full-div">
<chart-component v-if="!chart.type.includes('text') && renderComponent() === 'echarts'" class="chart-class" :chart="chart" /> <chart-component v-if="!chart.type.includes('text') && renderComponent() === 'echarts'" class="chart-class" :chart="chart" />
<chart-component-g2 v-if="!chart.type.includes('text') && renderComponent() === 'antv'" class="chart-class" :chart="chart" /> <chart-component-g2 v-if="!chart.type.includes('text') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
<label-normal v-if="chart.type.includes('text')" :chart="chart" class="table-class" /> <label-normal v-if="chart.type.includes('text')" :chart="chart" class="table-class" />
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
import ChartComponent from '@/views/chart/components/ChartComponent.vue' import ChartComponent from '@/views/chart/components/ChartComponent.vue'
import TableNormal from '@/views/chart/components/table/TableNormal' import TableNormal from '@/views/chart/components/table/TableNormal'
import LabelNormal from '@/views/chart/components/normal/LabelNormal' import LabelNormal from '@/views/chart/components/normal/LabelNormal'
import DeMainContainer from '@/components/dataease/DeMainContainer'
import DeContainer from '@/components/dataease/DeContainer'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import ChartComponentG2 from '@/views/chart/components/ChartComponentG2' import ChartComponentG2 from '@/views/chart/components/ChartComponentG2'
import DeMainContainer from '@/components/dataease/DeMainContainer'
import DeContainer from '@/components/dataease/DeContainer'
export default { export default {
name: 'UserViewMobileDialog', name: 'UserViewMobileDialog',
components: { ChartComponentG2, DeMainContainer, DeContainer, ChartComponent, TableNormal, LabelNormal }, components: { DeContainer, DeMainContainer, ChartComponentG2, ChartComponent, TableNormal, LabelNormal },
props: { props: {
chart: { chart: {
type: Object, type: Object,
...@@ -78,16 +78,8 @@ export default { ...@@ -78,16 +78,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ms-aside-container {
height: 50vh;
min-width: 400px;
max-width: 400px;
padding: 0 0;
}
.ms-main-container { .ms-main-container {
height: 100vh; border: 0px;
border: 1px solid #E6E6E6;
border-left: 0 solid;
} }
.chart-class{ .chart-class{
height: 100%; height: 100%;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
:element="element" :element="element"
:in-draw="inDraw" :in-draw="inDraw"
:in-screen="inScreen" :in-screen="inScreen"
:size="sizeInfo"
/> />
</div> </div>
</div> </div>
...@@ -49,16 +50,37 @@ export default { ...@@ -49,16 +50,37 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
},
h: {
type: Number,
default: 50
} }
}, },
data() { data() {
return { return {
inputMaxSize: 46,
inputLargeSize: 42,
inputSmallSize: 38,
inputMiniSize: 34,
options: null, options: null,
showNumber: false, showNumber: false,
mainClass: '' mainClass: ''
} }
}, },
computed: {
sizeInfo() {
let size
if (this.h > this.inputMaxSize) {
} else if (this.h > this.inputLargeSize) {
size = 'medium'
} else if (this.h > this.inputSmallSize) {
size = 'small'
} else {
size = 'mini'
}
return size
}
},
mounted() { mounted() {
this.watchSize() this.watchSize()
}, },
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
v-if="options!== null && options.attrs!==null" v-if="options!== null && options.attrs!==null"
:type="options.attrs.type" :type="options.attrs.type"
:round="options.attrs.round" :round="options.attrs.round"
:size="size"
> >
{{ options.value }} {{ options.value }}
</el-button> </el-button>
...@@ -20,7 +21,8 @@ export default { ...@@ -20,7 +21,8 @@ export default {
inDraw: { inDraw: {
type: Boolean, type: Boolean,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
:end-placeholder="$t(options.attrs.endPlaceholder)" :end-placeholder="$t(options.attrs.endPlaceholder)"
:placeholder="$t(options.attrs.placeholder)" :placeholder="$t(options.attrs.placeholder)"
:append-to-body="inScreen" :append-to-body="inScreen"
style="min-height: 36px;"
value-format="timestamp" value-format="timestamp"
:size="size"
@change="dateChange" @change="dateChange"
/> />
</template> </template>
...@@ -32,7 +32,8 @@ export default { ...@@ -32,7 +32,8 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:placeholder="$t(options.attrs.placeholder)" :placeholder="$t(options.attrs.placeholder)"
@keypress.enter.native="search" @keypress.enter.native="search"
@dblclick="setEdit" @dblclick="setEdit"
:size="size"
> >
<el-button slot="append" icon="el-icon-search" @click="search" /> <el-button slot="append" icon="el-icon-search" @click="search" />
...@@ -25,7 +26,8 @@ export default { ...@@ -25,7 +26,8 @@ export default {
inDraw: { inDraw: {
type: Boolean, type: Boolean,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
<template> <template>
<el-form v-if="options!== null && options.attrs!==null" ref="form" :model="form" :rules="rules"> <el-form v-if="options!== null && options.attrs!==null" ref="form" style="max-height:34px" :model="form" :rules="rules">
<div class="de-number-range-container"> <div class="de-number-range-container">
<el-form-item prop="min"> <el-form-item prop="min">
<el-input v-model="form.min" :placeholder="$t(options.attrs.placeholder_min)" @change="handleMinChange" /> <el-input v-model="form.min" :placeholder="$t(options.attrs.placeholder_min)" :size="size" @change="handleMinChange" />
</el-form-item> </el-form-item>
<span>{{ $t('denumberrange.split_placeholder') }}</span> <span>{{ $t('denumberrange.split_placeholder') }}</span>
<el-form-item prop="max"> <el-form-item prop="max">
<el-input v-model="form.max" :placeholder="$t(options.attrs.placeholder_max)" @change="handleMaxChange" /> <el-input v-model="form.max" :placeholder="$t(options.attrs.placeholder_max)" :size="size" @change="handleMaxChange" />
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -27,7 +27,8 @@ export default { ...@@ -27,7 +27,8 @@ export default {
inDraw: { inDraw: {
type: Boolean, type: Boolean,
default: true default: true
} },
size: String
}, },
data() { data() {
...@@ -186,6 +187,7 @@ export default { ...@@ -186,6 +187,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.de-number-range-container { .de-number-range-container {
display: inline; display: inline;
max-height: 40px;
>>>div.el-form-item { >>>div.el-form-item {
width: calc(50% - 10px) !important; width: calc(50% - 10px) !important;
display: inline-block; display: inline-block;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<el-quarter <el-quarter
v-if="options!== null && options.attrs!==null" v-if="options!== null && options.attrs!==null"
v-model="options.value" v-model="options.value"
:placeholder="options.attrs.placeholder" :placeholder="options.attrs.placeholder"
:size="size"
/> />
</template> </template>
...@@ -18,7 +18,8 @@ export default { ...@@ -18,7 +18,8 @@ export default {
inDraw: { inDraw: {
type: Boolean, type: Boolean,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:multiple="options.attrs.multiple" :multiple="options.attrs.multiple"
:placeholder="$t(options.attrs.placeholder)" :placeholder="$t(options.attrs.placeholder)"
:popper-append-to-body="inScreen" :popper-append-to-body="inScreen"
:size="size"
@change="changeValue" @change="changeValue"
@focus="setOptionWidth" @focus="setOptionWidth"
> >
...@@ -42,7 +43,8 @@ export default { ...@@ -42,7 +43,8 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div v-if="options!== null && options.attrs!==null" class="de-select-grid-class"> <div v-if="options!== null && options.attrs!==null" class="de-select-grid-class">
<div class="de-select-grid-search"> <div class="de-select-grid-search">
<el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" size="mini" prefix-icon="el-icon-search" clearable /> <el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" size="mini" prefix-icon="el-icon-search" clearable :size="size" />
</div> </div>
<div class="list"> <div class="list">
<el-tree <el-tree
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:props="defaultProp" :props="defaultProp"
:indent="0" :indent="0"
class="de-filter-tree" class="de-filter-tree"
:size="size"
default-expand-all default-expand-all
> >
<span slot-scope="{ node, data }" class="custom-tree-node-list father"> <span slot-scope="{ node, data }" class="custom-tree-node-list father">
...@@ -58,7 +59,8 @@ export default { ...@@ -58,7 +59,8 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
<template> <template>
<el-select v-if="options!== null && options.attrs!==null" v-model="values" :multiple="options.attrs.multiple" :placeholder="options.attrs.placeholder" :popper-append-to-body="inScreen" @change="changeValue"> <el-select :size="size" v-if="options!== null && options.attrs!==null" v-model="values" :multiple="options.attrs.multiple" :placeholder="options.attrs.placeholder" :popper-append-to-body="inScreen" @change="changeValue">
<el-option <el-option
v-for="item in options.attrs.datas" v-for="item in options.attrs.datas"
:key="item[options.attrs.key]" :key="item[options.attrs.key]"
...@@ -28,7 +28,8 @@ export default { ...@@ -28,7 +28,8 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
} },
size: String
}, },
data() { data() {
return { return {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
:style="getComponentStyleDefault(config.style)" :style="getComponentStyleDefault(config.style)"
:out-style="outStyle" :out-style="outStyle"
:element="config" :element="config"
:in-screen="true"
/> />
<component <component
:is="config.component" :is="config.component"
...@@ -30,10 +31,11 @@ ...@@ -30,10 +31,11 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar' import MobileCheckBar from '@/components/canvas/components/Editor/MobileCheckBar'
import { getStyle } from '@/components/canvas/utils/style' import { getStyle } from '@/components/canvas/utils/style'
import DeOutWidget from '@/components/dataease/DeOutWidget'
export default { export default {
name: 'ComponentWaitItem', name: 'ComponentWaitItem',
components: { MobileCheckBar }, components: { DeOutWidget, MobileCheckBar },
props: { props: {
config: { config: {
type: Object, type: Object,
...@@ -87,6 +89,7 @@ export default { ...@@ -87,6 +89,7 @@ export default {
<style scoped> <style scoped>
.component-custom { .component-custom {
position: relative!important;
outline: none; outline: none;
width: 100% !important; width: 100% !important;
height: 100%; height: 100%;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论