feat:边框组件优化

main
liu.tao3 2 years ago
parent 45dae66fcf
commit 68e6998f7a

@ -31,7 +31,7 @@
<div class="lc-field-body"> <div class="lc-field-body">
<BorderSetting <BorderSetting
v-if="config.border" v-if="config.border"
label-width="100px" label-width="120px"
:config="config.border" :config="config.border"
/> />
</div> </div>

@ -110,7 +110,7 @@ export const FlyMapData = {
name: '飞线图', name: '飞线图',
title: '飞线图', title: '飞线图',
icon: Icon.getNameList()[18], icon: Icon.getNameList()[18],
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:60,fontSize:30,isTitle:true,paddingTop:10},
className: className:
'com.gccloud.dataroom.core.module.chart.components.ScreenFlyMapChart', 'com.gccloud.dataroom.core.module.chart.components.ScreenFlyMapChart',
w: 800, w: 800,

@ -102,7 +102,7 @@ export const mapData = {
name: '地图', name: '地图',
title: '地图', title: '地图',
icon: Icon.getNameList()[5], icon: Icon.getNameList()[5],
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:60,fontSize:30,isTitle:true,paddingTop:30},
className: className:
'com.gccloud.dataroom.core.module.chart.components.ScreenMapChart', 'com.gccloud.dataroom.core.module.chart.components.ScreenMapChart',
w: 800, w: 800,

@ -25,7 +25,7 @@
<div class="lc-field-body"> <div class="lc-field-body">
<BorderSetting <BorderSetting
v-if="config.border" v-if="config.border"
label-width="120px" label-width="100px"
:config="config.border" :config="config.border"
/> />
</div> </div>

@ -27,7 +27,32 @@
ref="BorderSelect" ref="BorderSelect"
/> />
</el-form-item> </el-form-item>
<div v-if="config.type">
<el-form-item <el-form-item
:label-width="labelWidth"
label="是否显示标题"
>
<el-switch
v-model="config.isTitle"
class="bs-el-switch"
:active-value="true"
:inactive-value="false"
/>
</el-form-item>
<el-form-item
v-if="!config.isTitle"
:label-width="labelWidth"
label="上边距"
>
<el-input-number
v-model="config.paddingTop"
class="bs-el-input-number"
:min="0"
:step="1"
/>
</el-form-item>
<el-form-item
v-if="config.isTitle"
:label-width="labelWidth" :label-width="labelWidth"
label="标题高度" label="标题高度"
> >
@ -39,6 +64,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="config.isTitle"
:label-width="labelWidth" :label-width="labelWidth"
label="标题字体大小" label="标题字体大小"
> >
@ -49,13 +75,25 @@
:step="1" :step="1"
/> />
</el-form-item> </el-form-item>
<el-form-item
v-if="config.isTitle"
:label-width="labelWidth"
label="标题颜色"
>
<el-color-picker
v-model="config.fontColor"
popper-class="bs-el-color-picker"
class="bs-el-color-picker"
show-alpha
/>
</el-form-item>
<div <div
v-for="(setting, settingIndex) in list" v-for="(setting, settingIndex) in list"
:key="settingIndex+1" :key="settingIndex+1"
> >
<el-form-item <el-form-item
:label="setting.type=== 'padding' ? '' : setting.label" :label="setting.type=== 'padding' ? '' : setting.label"
:label-width="setting.type=== 'padding' ? '0px' :'120px'" :label-width="labelWidth"
> >
<el-input <el-input
v-if="setting.type === 'input'" v-if="setting.type === 'input'"
@ -165,6 +203,7 @@
v-model="config[setting.field]" v-model="config[setting.field]"
/> />
</el-form-item> </el-form-item>
</div>
</div> </div>
</div> </div>
</template> </template>

@ -21,8 +21,9 @@
/> />
</el-form-item> </el-form-item>
</div> </div>
<SettingTitle>边框</SettingTitle>
<div class="lc-field-body"> <div class="lc-field-body">
<BorderSetting <BorderSetting
v-if="config.border" v-if="config.border"
label-width="120px" label-width="120px"
:config="config.border" :config="config.border"

@ -295,6 +295,11 @@ export default {
setComponent (component) { setComponent (component) {
// component // component
getScreenInfo(component.code).then(res => { getScreenInfo(component.code).then(res => {
res.chartList.forEach((item) => {
if (!item.border) {
item.border={type:'',titleHeight:60,fontSize:30,isTitle:true,paddingTop:20}
}
})
// //
const randomStr = randomString(8) const randomStr = randomString(8)
const pageInfo = handleResData(res) const pageInfo = handleResData(res)

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -18,19 +18,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,19 +17,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -16,20 +16,7 @@ const setting = [
multiple: false, multiple: false,
// 绑定的值 // 绑定的值
value: '', value: '',
}, }
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -18,19 +18,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -16,20 +16,7 @@ const setting = [
multiple: false, multiple: false,
// 绑定的值 // 绑定的值
value: '', value: '',
}, }
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -16,21 +16,7 @@ const setting = [
multiple: false, multiple: false,
// 绑定的值 // 绑定的值
value: '', value: '',
}, }
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -16,20 +16,7 @@ const setting = [
multiple: false, multiple: false,
// 绑定的值 // 绑定的值
value: '', value: '',
}, }
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -10,6 +10,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,19 +17,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
{ {
label:'边框主颜色', label:'边框主颜色',
// 设置组件类型, select / input / colorPicker // 设置组件类型, select / input / colorPicker

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,19 +17,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,19 +17,7 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,19 +17,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -17,20 +17,6 @@ const setting = [
// 绑定的值 // 绑定的值
value: '', value: '',
}, },
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -9,6 +9,7 @@
:key="updateKey" :key="updateKey"
> >
<div class="element" <div class="element"
v-if="config.border.isTitle"
:style="` :style="`
color:${color}; color:${color};
font-size:${config.border.fontSize}px; font-size:${config.border.fontSize}px;

@ -16,20 +16,7 @@ const setting = [
multiple: false, multiple: false,
// 绑定的值 // 绑定的值
value: '', value: '',
}, }
// 标题字体颜色
{
label:'标题字体颜色',
// 设置组件类型, select / input / colorPicker
type: 'colorPicker',
// 字段
field: 'fontColor',
optionField: 'fontColor', // 对应options中的字段
// 是否多选
multiple: false,
// 绑定的值
value: '',
},
] ]

@ -32,7 +32,7 @@ function getPlotList (files) {
category: configMapKey, category: configMapKey,
name: config.name, name: config.name,
title: config.title, title: config.title,
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:100,fontSize:30,isTitle:true,paddingTop:30},
icon: null, icon: null,
img: require(`../G2Plots/images/componentLogo/${config.title}.png`), img: require(`../G2Plots/images/componentLogo/${config.title}.png`),
className: className:
@ -65,7 +65,7 @@ export function getCustomPlots () {
category: config.category, category: config.category,
name: config.name, name: config.name,
title: config.title, title: config.title,
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:100,fontSize:30,isTitle:true,paddingTop:30},
icon: null, icon: null,
img: config.img, img: config.img,
className: className:

@ -32,7 +32,7 @@ export function getRemoteComponents (comList) {
title: config.title, title: config.title,
icon: null, icon: null,
img: config.img, img: config.img,
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:100,fontSize:30,isTitle:true,paddingTop:30},
className: className:
'com.gccloud.dataroom.core.module.chart.components.RemoteComponentChart', 'com.gccloud.dataroom.core.module.chart.components.RemoteComponentChart',
w: 450, w: 450,
@ -64,7 +64,7 @@ export function getRemoteComponentConfig (code, name) {
title: name, title: name,
icon: null, icon: null,
img: null, img: null,
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:100,fontSize:30,isTitle:true,paddingTop:30},
className: className:
'com.gccloud.dataroom.core.module.chart.components.RemoteComponentChart', 'com.gccloud.dataroom.core.module.chart.components.RemoteComponentChart',
w: 450, w: 450,

@ -16,7 +16,7 @@
/> />
<div <div
class="render-item-wrap" class="render-item-wrap"
:style="`height:calc(100% - ${(config.border&&config.border.type)?config.border.titleHeight:0}px)`" :style="`height:calc(100% - ${(config.border&&config.border.type&&config.border.isTitle)?config.border.titleHeight:0}px);padding-top:${(config.border&&config.border.type&&!config.border.isTitle)?config.border.paddingTop:0}px`"
> >
<component <component
:is="resolveComponentType(config.type)" :is="resolveComponentType(config.type)"
@ -113,6 +113,6 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
padding-bottom:20px; padding-bottom: 15px;
} }
</style> </style>

@ -44,7 +44,7 @@ basicConfigList = basicConfigList.map((item) => {
export function basicComponentsConfig (item) { export function basicComponentsConfig (item) {
return { return {
...item, ...item,
border:{type:'',titleHeight:60,fontSize:30}, border:{type:'',titleHeight:60,fontSize:30,isTitle:true,paddingTop:30},
option: cloneDeep(setModules[item.type]), option: cloneDeep(setModules[item.type]),
...cloneDeep(dataModules[item.type]) ...cloneDeep(dataModules[item.type])
} }

@ -13,6 +13,12 @@ export default {
initLayout ({ commit, dispatch }, code) { initLayout ({ commit, dispatch }, code) {
return new Promise(resolve => { return new Promise(resolve => {
getScreenInfo(code).then(data => { getScreenInfo(code).then(data => {
// 兼容边框配置
data.chartList.forEach((item) => {
if (!item.border) {
item.border={type:'',titleHeight:60,fontSize:30,isTitle:true,paddingTop:10}
}
})
const pageInfo = handleResData(data) const pageInfo = handleResData(data)
// 改变页面数据 // 改变页面数据
commit('changePageInfo', pageInfo) commit('changePageInfo', pageInfo)

Loading…
Cancel
Save