Commit a64b43cb authored by 郭铭瑶's avatar 郭铭瑶 🤘

调整

parent cedc12b4
<template> <template>
<div id="app"> <div id="app" :style="getBgImg">
<m-loader v-show="$store.state.showLoading"/> <m-loader v-show="$store.state.showLoading"/>
<m-title hideDate hideTime :bgImg="require('@/assets/images/title-bg3.png')"/> <m-title hideDate hideTime :bgImg="require('@/assets/images/title-bg3.png')"/>
<m-animate enter="zoomIn" leave="zoomOut"> <m-animate enter="zoomIn" leave="zoomOut">
...@@ -11,20 +11,25 @@ ...@@ -11,20 +11,25 @@
<script> <script>
export default { export default {
name: 'App', name: 'App',
// computed: { computed: {
// style() { getBgImg() {
// return this.$route.path === '/quality-safety' const {path} = this.$route
// ? ({'background-size': '110%', 'background-position': '90% -50%'}) return (path === '/quality-safety' || path === '/seedling')
// : ({'background-size': '100%', 'background-position': '50% 50%'}) ? ({
// } 'background': `url(${require('./assets/images/bg.jpeg')})`,
// }, 'background-size': 'cover',
'background-position': 'center',
})
: ({})
}
},
} }
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
#app #app
background url('./assets/images/bg.png') no-repeat background url('./assets/images/bg.png')
// transition background 1s background-repeat no-repeat
background-size 110% background-size 110%
background-position 90% -50% background-position 90% -50%
.router-view .router-view
......
This diff is collapsed.
...@@ -24,13 +24,13 @@ export default { ...@@ -24,13 +24,13 @@ export default {
return { return {
showChart: false, showChart: false,
config: { config: {
// colors: ['#0062f0', '#49a7db', '#72b3f7', '#c8dfff'], colors: ['#0062f0', '#49a7db', '#72b3f7', '#c8dfff'].reverse(),
legend: { legend: {
hide: true, hide: true,
}, },
tooltip: { tooltip: {
formatter: '{b}<br/>{c}亩 ({d}%)',
confine: true, confine: true,
formatter: '{c}亩'
}, },
shape: [ shape: [
{type: 'pie', radius: [40 * Number((screen.height / 800).toFixed(1)), 60 * Number((screen.height / 800).toFixed(1))], startAngle: 30, label: {show: true, formatter: '{d}%\n{b}', fontSize: 12 * Number((screen.height / 800).toFixed(1))}, center: ['50%', '52%']} {type: 'pie', radius: [40 * Number((screen.height / 800).toFixed(1)), 60 * Number((screen.height / 800).toFixed(1))], startAngle: 30, label: {show: true, formatter: '{d}%\n{b}', fontSize: 12 * Number((screen.height / 800).toFixed(1))}, center: ['50%', '52%']}
......
...@@ -4,12 +4,17 @@ ...@@ -4,12 +4,17 @@
<Option v-for="item in options" :key="item" :value="item">{{item}}</Option> <Option v-for="item in options" :key="item" :value="item">{{item}}</Option>
</Select> </Select>
<div class="legend"> <div class="legend">
<p v-for="(item, i) in data" :key="item.name"><span :style="`background:${config.colors[i]}`"/> {{item.name}}</p> <p v-for="(item, i) in data2" :key="item.name"><span :style="`background:${config2.colors[i]}`"/> {{item.name}}</p>
</div> </div>
<div class="chart-wrapper" v-if="showChart"> <div class="chart-wrapper" v-if="showChart">
<div> <div>
<p class="title"><span/>面积</p> <p class="title"><span/>面积</p>
<m-chart :config="config" :data="data"/> <div>
<m-chart :config="{...config, colors: ['#41D9C7', 'gray']}" :data="data[0]"/>
<m-chart :config="{...config, colors: ['#2FC25B', '#FACC14', '#E6965C', '#223273', '#7564CC', '#5CA3E6', '#F04864', '#D598D9']}" :data="data[1]"/>
<span class="pointer"/>
<span class="pointer"/>
</div>
</div> </div>
<div> <div>
<div> <div>
...@@ -32,7 +37,11 @@ const mock = [ ...@@ -32,7 +37,11 @@ const mock = [
{ {
key: '水稻', key: '水稻',
data1: [ data1: [
[
{name: '稻小龙虾', value: 232816.3}, {name: '稻小龙虾', value: 232816.3},
{name: '剩余', value: 54575},
],
[
{name: '稻青虾', value: 520}, {name: '稻青虾', value: 520},
{name: '稻蟹', value: 7590}, {name: '稻蟹', value: 7590},
{name: '稻鲤', value: 9073}, {name: '稻鲤', value: 9073},
...@@ -41,7 +50,7 @@ const mock = [ ...@@ -41,7 +50,7 @@ const mock = [
{name: '稻蛙', value: 600}, {name: '稻蛙', value: 600},
{name: '稻螺', value: 0}, {name: '稻螺', value: 0},
{name: '其他', value: 28672}, {name: '其他', value: 28672},
// {value: 287391.3} ]
], ],
data2: [ data2: [
{name: '稻小龙虾', value: 124596.413}, {name: '稻小龙虾', value: 124596.413},
...@@ -117,11 +126,11 @@ export default { ...@@ -117,11 +126,11 @@ export default {
hide: true, hide: true,
}, },
tooltip: { tooltip: {
formatter: '{b}:{c}亩', formatter: '{b}<br/>{c}亩 ({d}%)',
confine: true, confine: true,
}, },
shape: [ shape: [
{type: 'pie', radius: [30 * Number((screen.height / 800).toFixed(1)), 50 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']} {type: 'pie', startAngle: -30, radius: [35 * Number((screen.height / 800).toFixed(1)), 50 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']}
] ]
}, },
data: mock[0].data1, data: mock[0].data1,
...@@ -130,6 +139,10 @@ export default { ...@@ -130,6 +139,10 @@ export default {
legend: { legend: {
hide: true, hide: true,
}, },
tooltip: {
formatter: '{b}<br/>{c}吨 ({d}%)',
confine: true,
},
shape: [ shape: [
{type: 'pie', radius: [30 * Number((screen.height / 800).toFixed(1)), 40 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']} {type: 'pie', radius: [30 * Number((screen.height / 800).toFixed(1)), 40 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']}
] ]
...@@ -140,6 +153,10 @@ export default { ...@@ -140,6 +153,10 @@ export default {
legend: { legend: {
hide: true, hide: true,
}, },
tooltip: {
formatter: '{b}<br/>{c}万元 ({d}%)',
confine: true,
},
shape: [ shape: [
{type: 'pie', radius: [30 * Number((screen.height / 800).toFixed(1)), 40 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']} {type: 'pie', radius: [30 * Number((screen.height / 800).toFixed(1)), 40 * Number((screen.height / 800).toFixed(1))], center: ['50%', '50%']}
] ]
...@@ -187,6 +204,25 @@ export default { ...@@ -187,6 +204,25 @@ export default {
>div >div
width 49% width 49%
height calc(100% - 1rem) height calc(100% - 1rem)
&:first-child
>div
width 100%
height 100%
display flex
position relative
.pointer
position absolute
background gray
left 35%
width 10rem
height 0.1rem
transform rotate(-15deg)
top 26%
&:last-child
transform rotate(15deg)
top 70%
>div
flex 1
&:last-child &:last-child
display flex display flex
border-left .1rem solid $color-map() border-left .1rem solid $color-map()
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
type: [String, Function], type: [String, Function],
default() { default() {
return ({data}) => { return ({data}) => {
if (data.region && data.company) { if (data && data.region && data.company) {
return ` return `
<div class="map-tooltip-info"> <div class="map-tooltip-info">
<h3>${data.name}</h3> <h3>${data.name}</h3>
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
<p><span>水产品总产值/产量:</span>${this.$com.transNumber(data.val2)}万元/${this.$com.transNumber(data.product2)}吨</p> <p><span>水产品总产值/产量:</span>${this.$com.transNumber(data.val2)}万元/${this.$com.transNumber(data.product2)}吨</p>
</div> </div>
` `
} else if (data.val1 && data.product1){ } else if (data && data.val1 && data.product1){
return ` return `
<div class="map-tooltip-info"> <div class="map-tooltip-info">
<h3>${data.name}</h3> <h3>${data.name}</h3>
......
...@@ -163,9 +163,10 @@ export default { ...@@ -163,9 +163,10 @@ export default {
curVideo: null, curVideo: null,
videoModal: false, videoModal: false,
mapConfig: { mapConfig: {
zoom: 7, zoom: 6,
zooms: [6, 15], zooms: [5, 15],
center: [121.973849, 28.142576], // 钓鱼岛附近 center: [121.694959, 38.869911], // 大连附近
// center: [121.973849, 28.142576], // 钓鱼岛附近
mapStyle: 'amap://styles/blue', mapStyle: 'amap://styles/blue',
features: ['bg', 'road', 'point'], features: ['bg', 'road', 'point'],
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment