refactor: 更新四个指标卡组件的左侧栏图标,从png资源换成svg资源

main
wu.jian2 1 year ago
parent 04cc30ea35
commit bbb948b6e1

Binary file not shown.

@ -5,9 +5,9 @@
> >
<div <div
:style="{ :style="{
'background-image': `linear-gradient(${customize.gradientDirection}, ${ 'background-image': `linear-gradient(${customize.gradientDirection}, ${
gradientColor0 ? gradientColor0 : gradientColor1 gradientColor0 ? gradientColor0 : gradientColor1
} , ${gradientColor1 ? gradientColor1 : gradientColor0})`, } , ${gradientColor1 ? gradientColor1 : gradientColor0})`,
'border-radius':customize.borderRadius + 'px', 'border-radius':customize.borderRadius + 'px',
border:`${customize.borderWidth}px solid ${customize.borderColor}`, border:`${customize.borderWidth}px solid ${customize.borderColor}`,
}" }"
@ -40,15 +40,16 @@
'margin-bottom':customize.lineDistance +'px' 'margin-bottom':customize.lineDistance +'px'
}" }"
> >
{{ optionData}} {{ optionData }}
<span <span
:style="{ :style="{
'margin-left':'10px', 'margin-left':'10px',
'font-size': customize.unitSize + 'px', 'font-size': customize.unitSize + 'px',
color:customize.unitColor, color:customize.unitColor,
}"> }"
{{unit}} >
</span> {{ unit }}
</span>
</span> </span>
<span <span
:style="{ :style="{
@ -82,7 +83,7 @@ export default {
}, },
data () { data () {
return { return {
imgUrl:require('data-room-ui/assets/images/cardImg/cardicon.png'), imgUrl: require('data-room-ui/assets/images/cardImg/cardicon.png'),
customClass: {} customClass: {}
} }
}, },
@ -94,9 +95,9 @@ export default {
return this.config.customize.gradientColor0 || this.config.customize.gradientColor1 || 'transparent' return this.config.customize.gradientColor0 || this.config.customize.gradientColor1 || 'transparent'
}, },
gradientColor1 () { gradientColor1 () {
return this.config.customize.gradientColor1 || this.config.customize.gradientColor0 || 'transparent' return this.config.customize.gradientColor1 || this.config.customize.gradientColor0 || 'transparent'
}, },
unit(){ unit () {
return this.config?.customize.unit || '' return this.config?.customize.unit || ''
}, },
option () { option () {
@ -107,12 +108,12 @@ export default {
}, },
customize () { customize () {
return this.config?.customize return this.config?.customize
}, }
}, },
methods: { methods: {
dataFormatting (config, data) { dataFormatting (config, data) {
let dataList = '' let dataList = ''
if(data.success){ if (data.success) {
if (data.data instanceof Array) { if (data.data instanceof Array) {
dataList = config.dataSource.dimensionField dataList = config.dataSource.dimensionField
? data.data[0][config.dataSource.dimensionField] ? data.data[0][config.dataSource.dimensionField]
@ -120,8 +121,8 @@ export default {
} else { } else {
dataList = data.data[config.dataSource.dimensionField] dataList = data.data[config.dataSource.dimensionField]
} }
}else{ } else {
dataList=80 dataList = 80
} }
config.option = { config.option = {
...config.option, ...config.option,
@ -129,7 +130,7 @@ export default {
} }
return config return config
} }
} }
} }
</script> </script>

@ -6,8 +6,8 @@
<div <div
:style="{ :style="{
'background-image': `linear-gradient(${customize.gradientDirection}, ${ 'background-image': `linear-gradient(${customize.gradientDirection}, ${
gradientColor0 ? gradientColor0 : gradientColor1 gradientColor0 ? gradientColor0 : gradientColor1
} , ${gradientColor1 ? gradientColor1 : gradientColor0})`, } , ${gradientColor1 ? gradientColor1 : gradientColor0})`,
'border-radius':customize.borderRadius + 'px', 'border-radius':customize.borderRadius + 'px',
border:`${customize.borderWidth}px solid ${customize.borderColor}`, border:`${customize.borderWidth}px solid ${customize.borderColor}`,
}" }"
@ -49,15 +49,16 @@
}" }"
class="content-right-second" class="content-right-second"
> >
{{ optionData}} {{ optionData }}
<span <span
:style="{ :style="{
'margin-left':'10px', 'margin-left':'10px',
'font-size': customize.unitSize + 'px', 'font-size': customize.unitSize + 'px',
color:customize.unitColor, color:customize.unitColor,
}"> }"
{{unit}} >
</span> {{ unit }}
</span>
</span> </span>
</div> </div>
</div> </div>
@ -80,7 +81,7 @@ export default {
}, },
data () { data () {
return { return {
imgUrl:require('data-room-ui/assets/images/cardImg/cardicon.png'), imgUrl: require('data-room-ui/assets/images/cardImg/cardicon.png'),
customClass: {} customClass: {}
} }
}, },
@ -88,13 +89,13 @@ export default {
mounted () { mounted () {
}, },
computed: { computed: {
gradientColor0 () { gradientColor0 () {
return this.config.customize.gradientColor0 || this.config.customize.gradientColor1 || 'transparent' return this.config.customize.gradientColor0 || this.config.customize.gradientColor1 || 'transparent'
}, },
gradientColor1 () { gradientColor1 () {
return this.config.customize.gradientColor1 || this.config.customize.gradientColor0 || 'transparent' return this.config.customize.gradientColor1 || this.config.customize.gradientColor0 || 'transparent'
}, },
unit(){ unit () {
return this.config?.customize.unit || '' return this.config?.customize.unit || ''
}, },
option () { option () {
@ -105,12 +106,12 @@ export default {
}, },
customize () { customize () {
return this.config?.customize return this.config?.customize
}, }
}, },
methods: { methods: {
dataFormatting (config, data) { dataFormatting (config, data) {
let dataList = '' let dataList = ''
if(data.success){ if (data.success) {
if (data.data instanceof Array) { if (data.data instanceof Array) {
dataList = config.dataSource.dimensionField dataList = config.dataSource.dimensionField
? data.data[0][config.dataSource.dimensionField] ? data.data[0][config.dataSource.dimensionField]
@ -118,8 +119,8 @@ export default {
} else { } else {
dataList = data.data[config.dataSource.dimensionField] dataList = data.data[config.dataSource.dimensionField]
} }
}else{ } else {
dataList=80 dataList = 80
} }
config.option = { config.option = {
...config.option, ...config.option,
@ -127,7 +128,7 @@ export default {
} }
return config return config
} }
} }
} }
</script> </script>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 36 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

@ -303,8 +303,8 @@ export default function getComponentConfig (type) {
return { return {
name: '指标卡一', name: '指标卡一',
title: '指标卡一', title: '指标卡一',
icon: null, icon: Icon.getNameList()[30],
img: require('data-room-ui/assets/images/cardImg/card.png'), // img: require('data-room-ui/assets/images/cardImg/card.png'),
className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndicatorCardChart', className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndicatorCardChart',
w: 300, w: 300,
h: 114, h: 114,
@ -316,8 +316,8 @@ export default function getComponentConfig (type) {
return { return {
name: '指标卡二', name: '指标卡二',
title: '指标卡二', title: '指标卡二',
icon: null, icon: Icon.getNameList()[31],
img: require('data-room-ui/assets/images/cardImg/card2.png'), // img: require('data-room-ui/assets/images/cardImg/card2.png'),
className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndicatorCardChart', className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndicatorCardChart',
w: 300, w: 300,
h: 114, h: 114,
@ -329,8 +329,8 @@ export default function getComponentConfig (type) {
return { return {
name: '指标卡三', name: '指标卡三',
title: '指标卡三', title: '指标卡三',
icon: null, icon: Icon.getNameList()[32],
img: require('data-room-ui/assets/images/cardImg/indicard.png'), // img: require('data-room-ui/assets/images/cardImg/indicard.png'),
className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndexCardChart', className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndexCardChart',
w: 300, w: 300,
h: 114, h: 114,
@ -342,8 +342,8 @@ export default function getComponentConfig (type) {
return { return {
name: '指标卡四', name: '指标卡四',
title: '指标卡四', title: '指标卡四',
icon: null, icon: Icon.getNameList()[33],
img: require('data-room-ui/assets/images/cardImg/indcard2.png'), // img: require('data-room-ui/assets/images/cardImg/indcard2.png'),
className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndexCardChart', className: 'com.gccloud.dataroom.core.module.chart.components.ScreenIndexCardChart',
w: 300, w: 300,
h: 114, h: 114,

Loading…
Cancel
Save