update screenDesigner

qianming 3 years ago
parent cdff1bdb70
commit c042654393

@ -295,41 +295,41 @@ export const widgetAirbubbleMap = {
relactiveDom: 'dataType', relactiveDom: 'dataType',
relactiveDomValue: 'staticData', relactiveDomValue: 'staticData',
value: [ value: [
{"name":"南海诸岛","value":1}, {"name": "南海诸岛", "value": 1},
{"name":"北京市","value":524}, {"name": "北京市", "value": 524},
{"name":"天津市","value":14}, {"name": "天津市", "value": 14},
{"name":"上海市","value":150}, {"name": "上海市", "value": 150},
{"name":"重庆市","value":75}, {"name": "重庆市", "value": 75},
{"name":"河北省","value":13}, {"name": "河北省", "value": 13},
{"name":"河南省","value":83}, {"name": "河南省", "value": 83},
{"name":"云南省","value":11}, {"name": "云南省", "value": 11},
{"name":"辽宁省","value":19}, {"name": "辽宁省", "value": 19},
{"name":"黑龙江省","value":15}, {"name": "黑龙江省", "value": 15},
{"name":"湖南省","value":69}, {"name": "湖南省", "value": 69},
{"name":"安徽省","value":260}, {"name": "安徽省", "value": 260},
{"name":"山东省","value":39}, {"name": "山东省", "value": 39},
{"name":"新疆维吾尔自治区","value":4}, {"name": "新疆维吾尔自治区", "value": 4},
{"name":"江苏省","value":31}, {"name": "江苏省", "value": 31},
{"name":"浙江省","value":104}, {"name": "浙江省", "value": 104},
{"name":"江西省","value":36}, {"name": "江西省", "value": 36},
{"name":"湖北省","value":1052}, {"name": "湖北省", "value": 1052},
{"name":"广西壮族自治区","value":33}, {"name": "广西壮族自治区", "value": 33},
{"name":"甘肃省","value":347}, {"name": "甘肃省", "value": 347},
{"name":"山西省","value":8}, {"name": "山西省", "value": 8},
{"name":"内蒙古自治区","value":157}, {"name": "内蒙古自治区", "value": 157},
{"name":"陕西省","value":22}, {"name": "陕西省", "value": 22},
{"name":"吉林省","value":4}, {"name": "吉林省", "value": 4},
{"name":"福建省","value":36}, {"name": "福建省", "value": 36},
{"name":"贵州省","value":39}, {"name": "贵州省", "value": 39},
{"name":"广东省","value":996}, {"name": "广东省", "value": 996},
{"name":"青海省","value":27}, {"name": "青海省", "value": 27},
{"name":"西藏自治区","value":31}, {"name": "西藏自治区", "value": 31},
{"name":"四川省","value":46}, {"name": "四川省", "value": 46},
{"name":"宁夏回族自治区","value":16}, {"name": "宁夏回族自治区", "value": 16},
{"name":"海南省","value":22}, {"name": "海南省", "value": 22},
{"name":"台湾省","value":6}, {"name": "台湾省", "value": 6},
{"name":"香港","value":2}, {"name": "香港", "value": 2},
{"name":"澳门","value":9}], {"name": "澳门", "value": 9}],
}, },
{ {
type: 'dycustComponents', type: 'dycustComponents',
@ -379,4 +379,4 @@ export const widgetAirbubbleMap = {
}, },
] ]
} }
} }

@ -30,7 +30,7 @@ import WidgetPiechart from "../widget/pieCharts/widgetPiechart.vue";
import WidgetFunnel from "../widget/funnelCharts/widgetFunnel.vue"; import WidgetFunnel from "../widget/funnelCharts/widgetFunnel.vue";
import WidgetGauge from "../widget/percentCharts/widgetGauge.vue"; import WidgetGauge from "../widget/percentCharts/widgetGauge.vue";
import WidgetPieNightingaleRoseArea from "../widget/pieCharts/widgetPieNightingaleRose"; import WidgetPieNightingaleRoseArea from "../widget/pieCharts/widgetPieNightingaleRose";
import widgetMap from "../widget/mapCharts/widgetMap.vue"; import widgetLineMap from "../widget/mapCharts/widgetLineMap.vue";
import widgetPiePercentageChart from "../widget/percentCharts/widgetPiePercentageChart"; import widgetPiePercentageChart from "../widget/percentCharts/widgetPiePercentageChart";
import widgetAirBubbleMap from "../widget/mapCharts/widgetAirBubbleMap"; import widgetAirBubbleMap from "../widget/mapCharts/widgetAirBubbleMap";
import widgetBarStackChart from "../widget/barCharts/widgetBarStackChart"; import widgetBarStackChart from "../widget/barCharts/widgetBarStackChart";
@ -62,7 +62,7 @@ export default {
WidgetFunnel, WidgetFunnel,
WidgetGauge, WidgetGauge,
WidgetPieNightingaleRoseArea, WidgetPieNightingaleRoseArea,
widgetMap, widgetLineMap,
widgetPiePercentageChart, widgetPiePercentageChart,
widgetAirBubbleMap, widgetAirBubbleMap,
widgetBarStackChart, widgetBarStackChart,

@ -28,7 +28,7 @@ import {widgetBarlinechart} from "./barlineCharts/widget-barlinechart"
import {widgetPiechart} from "./pieCharts/widget-piechart" import {widgetPiechart} from "./pieCharts/widget-piechart"
import {widgetFunnel} from "./funnelCharts/widget-funnel" import {widgetFunnel} from "./funnelCharts/widget-funnel"
import {widgetGauge} from "./percentCharts/widget-gauge" import {widgetGauge} from "./percentCharts/widget-gauge"
import {widgetMap} from "./mapCharts/widget-map" import {widgetLineMap} from "./mapCharts/widget-line-map"
import {widgetPieNightingale} from "./pieCharts/widget-pie-nightingale" import {widgetPieNightingale} from "./pieCharts/widget-pie-nightingale"
import {widgetPiePercentage} from "./percentCharts/widget-pie-percentage" import {widgetPiePercentage} from "./percentCharts/widget-pie-percentage"
import {widgetAirbubbleMap} from "./mapCharts/widget-airbubble-map" import {widgetAirbubbleMap} from "./mapCharts/widget-airbubble-map"
@ -59,7 +59,7 @@ export const widgetTool = [
widgetPiechart, widgetPiechart,
widgetFunnel, widgetFunnel,
widgetGauge, widgetGauge,
widgetMap, widgetLineMap,
widgetPieNightingale, widgetPieNightingale,
widgetPiePercentage, widgetPiePercentage,
widgetAirbubbleMap, widgetAirbubbleMap,

@ -9,7 +9,7 @@
export const widgetAirbubbleMap = { export const widgetAirbubbleMap = {
code: 'widgetAirBubbleMap', code: 'widgetAirBubbleMap',
type: 'mapChart', type: 'mapChart',
tabName: '地图', tabName: '中国地图',
label: '气泡地图', label: '气泡地图',
icon: 'iconzhongguoditu', icon: 'iconzhongguoditu',
options: { options: {
@ -21,7 +21,7 @@ export const widgetAirbubbleMap = {
name: 'layerName', name: 'layerName',
required: false, required: false,
placeholder: '', placeholder: '',
value: '气泡图', value: '中国地图-气泡图',
}, },
{ {
type: 'vue-color', type: 'vue-color',
@ -29,7 +29,7 @@ export const widgetAirbubbleMap = {
name: 'background', name: 'background',
required: false, required: false,
placeholder: '', placeholder: '',
value: '#0F1C3C' value: ''
}, },
[ [
{ {
@ -297,38 +297,38 @@ export const widgetAirbubbleMap = {
relactiveDomValue: 'staticData', relactiveDomValue: 'staticData',
value: [ value: [
{"name": "南海诸岛", "value": 1}, {"name": "南海诸岛", "value": 1},
{"name": "北京", "value": 524}, {"name": "北京", "value": 524},
{"name": "天津", "value": 14}, {"name": "天津", "value": 14},
{"name": "上海", "value": 150}, {"name": "上海", "value": 150},
{"name": "重庆", "value": 75}, {"name": "重庆", "value": 75},
{"name": "河北", "value": 13}, {"name": "河北", "value": 13},
{"name": "河南", "value": 83}, {"name": "河南", "value": 83},
{"name": "云南", "value": 11}, {"name": "云南", "value": 11},
{"name": "辽宁", "value": 19}, {"name": "辽宁", "value": 19},
{"name": "黑龙江", "value": 15}, {"name": "黑龙江", "value": 15},
{"name": "湖南", "value": 69}, {"name": "湖南", "value": 69},
{"name": "安徽", "value": 260}, {"name": "安徽", "value": 260},
{"name": "山东", "value": 39}, {"name": "山东", "value": 39},
{"name": "新疆", "value": 4}, {"name": "新疆维吾尔自治区", "value": 4},
{"name": "江苏", "value": 31}, {"name": "江苏", "value": 31},
{"name": "浙江", "value": 104}, {"name": "浙江", "value": 104},
{"name": "江西", "value": 36}, {"name": "江西", "value": 36},
{"name": "湖北", "value": 1052}, {"name": "湖北", "value": 1052},
{"name": "广西", "value": 33}, {"name": "广西壮族自治区", "value": 33},
{"name": "甘肃", "value": 347}, {"name": "甘肃", "value": 347},
{"name": "山西", "value": 8}, {"name": "山西", "value": 8},
{"name": "内蒙古", "value": 157}, {"name": "内蒙古自治区", "value": 157},
{"name": "陕西", "value": 22}, {"name": "陕西", "value": 22},
{"name": "吉林", "value": 4}, {"name": "吉林", "value": 4},
{"name": "福建", "value": 36}, {"name": "福建", "value": 36},
{"name": "贵州", "value": 39}, {"name": "贵州", "value": 39},
{"name": "广东", "value": 996}, {"name": "广东", "value": 996},
{"name": "青海", "value": 27}, {"name": "青海", "value": 27},
{"name": "西藏", "value": 31}, {"name": "西藏自治区", "value": 31},
{"name": "四川", "value": 46}, {"name": "四川", "value": 46},
{"name": "宁夏", "value": 16}, {"name": "宁夏回族自治区", "value": 16},
{"name": "海南", "value": 22}, {"name": "海南", "value": 22},
{"name": "台湾", "value": 6}, {"name": "台湾", "value": 6},
{"name": "香港", "value": 2}, {"name": "香港", "value": 2},
{"name": "澳门", "value": 9}], {"name": "澳门", "value": 9}],
}, },

@ -0,0 +1,464 @@
/*
* @Descripttion: 中国地图 json
* @version:
* @Author: qianlishi
* @Date: 2021-08-29 07:31:21
* @LastEditors: qianlishi
* @LastEditTime: 2021-09-28 14:17:20
*/
export const widgetLineMap = {
code: 'widgetLineMap',
type: 'mapChart',
tabName: '中国地图',
label: '路线地图',
icon: 'iconzhongguoditu',
options: {
setup: [
{
type: 'el-input-text',
label: '图层名称',
name: 'layerName',
required: false,
placeholder: '',
value: '中国地图-路线图',
},
{
type: 'vue-color',
label: '背景颜色',
name: 'background',
required: false,
placeholder: '',
value: ''
},
[
{
name: '标题设置',
list: [
{
type: 'el-switch',
label: '标题',
name: 'isNoTitle',
required: false,
placeholder: '',
value: true
},
{
type: 'el-input-text',
label: '标题',
name: 'titleText',
required: false,
placeholder: '',
value: ''
},
{
type: 'vue-color',
label: '字体颜色',
name: 'textColor',
required: false,
placeholder: '',
value: '#fff'
},
{
type: 'el-select',
label: '字体粗细',
name: 'textFontWeight',
required: false,
placeholder: '',
selectOptions: [
{code: 'normal', name: '正常'},
{code: 'bold', name: '粗体'},
{code: 'bolder', name: '特粗体'},
{code: 'lighter', name: '细体'}
],
value: 'normal'
},
{
type: 'el-input-number',
label: '字体大小',
name: 'textFontSize',
required: false,
placeholder: '',
value: 20
},
{
type: 'el-select',
label: '字体位置',
name: 'textAlign',
required: false,
placeholder: '',
selectOptions: [
{code: 'center', name: '居中'},
{code: 'left', name: '左对齐'},
{code: 'right', name: '右对齐'},
],
value: 'center'
},
{
type: 'el-input-text',
label: '副标题',
name: 'subText',
required: false,
placeholder: '',
value: ''
},
{
type: 'vue-color',
label: '字体颜色',
name: 'subTextColor',
required: false,
placeholder: '',
value: ''
},
{
type: 'el-select',
label: '字体粗细',
name: 'subTextFontWeight',
required: false,
placeholder: '',
selectOptions: [
{code: 'normal', name: '正常'},
{code: 'bold', name: '粗体'},
{code: 'bolder', name: '特粗体'},
{code: 'lighter', name: '细体'}
],
value: 'normal'
},
{
type: 'el-input-number',
label: '字体大小',
name: 'subTextFontSize',
required: false,
placeholder: '',
value: 12
},
],
},
{
name: '起点设置',
list: [
{
type: 'el-switch',
label: '起点显示',
name: 'isShowSource',
required: false,
placeholder: '',
value: true
},
{
type: 'el-input-number',
label: '点大小',
name: 'sourceSymbolSize',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '点颜色',
name: 'sourcePointColor',
required: false,
placeholder: '',
value: '#46bee9'
},
{
type: 'el-input-number',
label: '文字大小',
name: 'sourceFontTextSize',
required: false,
placeholder: '',
value: 12,
},
{
type: 'vue-color',
label: '文字颜色',
name: 'sourceFontTextColor',
required: false,
placeholder: '',
value: '#46bee9'
},
{
type: 'el-select',
label: '文字粗细',
name: 'sourceFontTextWeight',
required: false,
placeholder: '',
selectOptions: [
{code: 'normal', name: '正常'},
{code: 'bold', name: '粗体'},
{code: 'bolder', name: '特粗体'},
{code: 'lighter', name: '细体'}
],
value: 'normal'
},
],
},
{
name: '终点设置',
list: [
{
type: 'el-switch',
label: '终点显示',
name: 'isShowTarget',
required: false,
placeholder: '',
value: true
},
{
type: 'el-input-number',
label: '点大小',
name: 'targetSymbolSize',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '点颜色',
name: 'targetPointColor',
required: false,
placeholder: '',
value: '#46bee9'
},
{
type: 'el-input-number',
label: '文字大小',
name: 'targetFontTextSize',
required: false,
placeholder: '',
value: 12,
},
{
type: 'vue-color',
label: '文字颜色',
name: 'targetFontTextColor',
required: false,
placeholder: '',
value: '#46bee9'
},
{
type: 'el-select',
label: '文字粗细',
name: 'targetFontTextWeight',
required: false,
placeholder: '',
selectOptions: [
{code: 'normal', name: '正常'},
{code: 'bold', name: '粗体'},
{code: 'bolder', name: '特粗体'},
{code: 'lighter', name: '细体'}
],
value: 'normal'
},
],
},
{
name: '图标设置',
list: [
{
type: 'el-select',
label: '图标样式',
name: 'symbol',
required: false,
placeholder: '',
selectOptions: [
{code: 'arrow', name: '箭头'},
{code: 'plane', name: '飞机'},
],
value: 'arrow'
},
{
type: 'el-input-number',
label: '动画速度',
name: 'symbolPeriod',
required: false,
placeholder: '',
value: 4,
},
{
type: 'el-input-number',
label: '图标大小',
name: 'symbolSize',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '图标颜色',
name: 'symbolColor',
required: false,
placeholder: '',
value: '#46bee9'
},
],
},
{
name: '线设置',
list: [
{
type: 'vue-color',
label: '线颜色',
name: 'lineColor',
required: false,
placeholder: '',
value: '#ffa022'
},
{
type: 'el-input-number',
label: '线宽度',
name: 'lineWidth',
required: false,
placeholder: '',
value: 2,
},
],
},
{
name: '地图颜色',
list: [
{
type: 'vue-color',
label: '地图块颜色',
name: 'blockColor',
required: false,
placeholder: '',
value: '#073684'
},
{
type: 'vue-color',
label: '边界颜色',
name: 'borderColor',
required: false,
placeholder: '',
value: '#061E3D'
},
{
type: 'vue-color',
label: '高亮颜色',
name: 'highlightColor',
required: false,
placeholder: '',
value: '#2B91B7'
},
],
},
]
],
data: [
{
type: 'el-radio-group',
label: '数据类型',
name: 'dataType',
require: false,
placeholder: '',
selectValue: true,
selectOptions: [
{
code: 'staticData',
name: '静态数据',
},
{
code: 'dynamicData',
name: '动态数据',
},
],
value: 'staticData',
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: 5000
},
{
type: 'el-button',
label: '静态数据',
name: 'staticData',
required: false,
placeholder: '',
relactiveDom: 'dataType',
relactiveDomValue: 'staticData',
value: [
{source: '北京市', target: '上海市', value: 95},
{source: '北京市', target: '广州市', value: 90},
{source: '北京市', target: '大连市', value: 80},
{source: '北京市', target: '南宁市', value: 70},
{source: '北京市', target: '南昌市', value: 60},
{source: '北京市', target: '拉萨市', value: 50},
{source: '北京市', target: '长春市', value: 40},
{source: '北京市', target: '包头市', value: 30},
{source: '北京市', target: '重庆市', value: 20},
{source: '北京市', target: '常州市', value: 10},
{source: '上海市', target: '包头市', value: 95},
{source: '上海市', target: '昆明市', value: 90},
{source: '上海市', target: '广州市', value: 80},
{source: '上海市', target: '郑州市', value: 70},
{source: '上海市', target: '长春市', value: 60},
{source: '上海市', target: '重庆市', value: 50},
{source: '上海市', target: '长沙市', value: 40},
{source: '上海市', target: '北京市', value: 30},
{source: '上海市', target: '丹东市', value: 20},
{source: '上海市', target: '大连市', value: 10},
{source: '广州市', target: '福州市', value: 95},
{source: '广州市', target: '太原市', value: 90},
{source: '广州市', target: '长春市', value: 80},
{source: '广州市', target: '重庆市', value: 70},
{source: '广州市', target: '西安市', value: 60},
{source: '广州市', target: '成都市', value: 50},
{source: '广州市', target: '常州市', value: 40},
{source: '广州市', target: '北京市', value: 30},
{source: '广州市', target: '北海市', value: 20},
{source: '广州市', target: '海口市', value: 10},
],
},
{
type: 'dycustComponents',
label: '',
name: 'dynamicData',
required: false,
placeholder: '',
relactiveDom: 'dataType',
chartType: 'widget-linemap',
dictKey: 'SOUTAR_PROPERTIES',
relactiveDomValue: 'dynamicData',
value: '',
},
],
position: [
{
type: 'el-input-number',
label: '左边距',
name: 'left',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '上边距',
name: 'top',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '宽度',
name: 'width',
required: false,
placeholder: '该容器在1920px大屏中的宽度',
value: 600,
},
{
type: 'el-input-number',
label: '高度',
name: 'height',
required: false,
placeholder: '该容器在1080px大屏中的高度',
value: 400,
},
]
}
}

@ -1,62 +0,0 @@
/*
* @Descripttion: 中国地图 json
* @version:
* @Author: qianlishi
* @Date: 2021-08-29 07:31:21
* @LastEditors: qianlishi
* @LastEditTime: 2021-09-28 14:17:20
*/
export const widgetMap = {
code: 'widget-map',
type: 'mapChart',
tabName: '地图',
label: '中国地图',
icon: 'iconzhongguoditu',
options: {
setup: [
{
type: 'el-input-text',
label: '图层名称',
name: 'layerName',
required: false,
placeholder: '',
value: '迁徙图',
},
],
data: [],
position: [
{
type: 'el-input-number',
label: '左边距',
name: 'left',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '上边距',
name: 'top',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-input-number',
label: '宽度',
name: 'width',
required: false,
placeholder: '该容器在1920px大屏中的宽度',
value: 600,
},
{
type: 'el-input-number',
label: '高度',
name: 'height',
required: false,
placeholder: '该容器在1080px大屏中的高度',
value: 400,
},
]
}
}

@ -4,7 +4,7 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-08-29 07:05:52 * @Date: 2021-08-29 07:05:52
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2022-03-11 10:38:16 * @LastEditTime: 2021-09-28 14:20:30
*/ */
export const widgetTime = { export const widgetTime = {
code: 'widget-time', code: 'widget-time',
@ -57,7 +57,7 @@ export const widgetTime = {
name: 'fontSize', name: 'fontSize',
required: false, required: false,
placeholder: '', placeholder: '',
value: '26' value: '36'
}, },
{ {
type: 'vue-color', type: 'vue-color',
@ -129,7 +129,7 @@ export const widgetTime = {
name: 'width', name: 'width',
required: false, required: false,
placeholder: '该容器在1920px大屏中的宽度', placeholder: '该容器在1920px大屏中的宽度',
value: 300, value: 400,
}, },
{ {
type: 'el-input-number', type: 'el-input-number',
@ -137,7 +137,7 @@ export const widgetTime = {
name: 'height', name: 'height',
required: false, required: false,
placeholder: '该容器在1080px大屏中的高度', placeholder: '该容器在1080px大屏中的高度',
value: 100, value: 50,
}, },
], ],
} }

@ -32,7 +32,7 @@ import WidgetPiechart from "./pieCharts/widgetPiechart.vue";
import WidgetFunnel from "./funnelCharts/widgetFunnel.vue"; import WidgetFunnel from "./funnelCharts/widgetFunnel.vue";
import WidgetGauge from "./percentCharts/widgetGauge.vue"; import WidgetGauge from "./percentCharts/widgetGauge.vue";
import WidgetPieNightingaleRoseArea from "./pieCharts/widgetPieNightingaleRose"; import WidgetPieNightingaleRoseArea from "./pieCharts/widgetPieNightingaleRose";
import widgetMap from "./mapCharts/widgetMap.vue"; import widgetLineMap from "./mapCharts/widgetLineMap.vue";
import widgetPiePercentageChart from "./percentCharts/widgetPiePercentageChart"; import widgetPiePercentageChart from "./percentCharts/widgetPiePercentageChart";
import widgetAirBubbleMap from "./mapCharts/widgetAirBubbleMap"; import widgetAirBubbleMap from "./mapCharts/widgetAirBubbleMap";
import widgetBarStackChart from "./barCharts/widgetBarStackChart"; import widgetBarStackChart from "./barCharts/widgetBarStackChart";
@ -64,7 +64,7 @@ export default {
WidgetFunnel, WidgetFunnel,
WidgetGauge, WidgetGauge,
WidgetPieNightingaleRoseArea, WidgetPieNightingaleRoseArea,
widgetMap, widgetLineMap,
widgetPiePercentageChart, widgetPiePercentageChart,
widgetAirBubbleMap, widgetAirBubbleMap,
widgetBarStackChart, widgetBarStackChart,

@ -9,38 +9,40 @@ import "../../../../../node_modules/echarts/map/js/china.js";
//https://www.makeapie.com/editor.html?c=x2yaz6dfRw //https://www.makeapie.com/editor.html?c=x2yaz6dfRw
//https://www.makeapie.com/editor.html?c=xMpGBbTEKU //https://www.makeapie.com/editor.html?c=xMpGBbTEKU
let geoCoordMap = { let geoCoordMap = {
台湾: [121.5135, 25.0308], 台湾省: [121.5135, 25.0308],
黑龙江: [127.9688, 45.368], 黑龙江省: [127.9688, 45.368],
内蒙古: [110.3467, 41.4899], 内蒙古自治区: [110.3467, 41.4899],
吉林: [125.8154, 44.2584], 吉林省: [125.8154, 44.2584],
北京: [116.4551, 40.2539], 北京市: [116.4551, 40.2539],
辽宁: [123.1238, 42.1216], 辽宁省: [123.1238, 42.1216],
河北: [114.4995, 38.1006], 河北省: [114.4995, 38.1006],
天津: [117.4219, 39.4189], 天津市: [117.4219, 39.4189],
山西: [112.3352, 37.9413], 山西省: [112.3352, 37.9413],
陕西: [109.1162, 34.2004], 陕西省: [109.1162, 34.2004],
甘肃: [103.5901, 36.3043], 甘肃省: [103.5901, 36.3043],
宁夏: [106.3586, 38.1775], 宁夏回族自治区: [106.3586, 38.1775],
青海: [101.4038, 36.8207], 青海省: [101.4038, 36.8207],
新疆: [87.9236, 43.5883], 新疆维吾尔自治区: [87.9236, 43.5883],
西藏: [91.11, 29.97], 西藏自治区: [91.11, 29.97],
四川: [103.9526, 30.7617], 四川省: [103.9526, 30.7617],
重庆: [108.384366, 30.439702], 重庆市: [108.384366, 30.439702],
山东: [117.1582, 36.8701], 山东省: [117.1582, 36.8701],
河南: [113.4668, 34.6234], 河南省: [113.4668, 34.6234],
江苏: [118.8062, 31.9208], 江苏省: [118.8062, 31.9208],
安徽: [117.29, 32.0581], 安徽省: [117.29, 32.0581],
湖北: [114.3896, 30.6628], 湖北省: [114.3896, 30.6628],
浙江: [119.5313, 29.8773], 浙江省: [119.5313, 29.8773],
福建: [119.4543, 25.9222], 福建省: [119.4543, 25.9222],
江西: [116.0046, 28.6633], 江西省: [116.0046, 28.6633],
湖南: [113.0823, 28.2568], 湖南省: [113.0823, 28.2568],
贵州: [106.6992, 26.7682], 贵州省: [106.6992, 26.7682],
云南: [102.9199, 25.4663], 云南省: [102.9199, 25.4663],
广东: [113.12244, 23.009505], 广东省: [113.12244, 23.009505],
广西: [108.479, 23.1152], 广西壮族自治区: [108.479, 23.1152],
海南: [110.3893, 19.8516], 海南省: [110.3893, 19.8516],
上海: [121.4648, 31.2891] 上海市: [121.4648, 31.2891],
香港: [114.173355,22.320048],
澳门: [113.54909,22.198951]
}; };
let data = [ let data = [
{ {

@ -0,0 +1,552 @@
<template>
<div :style="styleObj">
<v-chart :options="options" autoresize/>
</div>
</template>
<script>
import "echarts/map/js/china.js";
import echarts from "echarts";
import {conversionCity} from '@/utils/china';
/*let geoCoordMap = {
上海市: [121.4648, 31.2891],
东莞市: [113.8953, 22.901],
东营市: [118.7073, 37.5513],
中山市: [113.4229, 22.478],
临汾市: [111.4783, 36.1615],
临沂市: [118.3118, 35.2936],
丹东市: [124.541, 40.4242],
丽水市: [119.5642, 28.1854],
乌鲁木齐市: [87.9236, 43.5883],
佛山市: [112.8955, 23.1097],
保定市: [115.0488, 39.0948],
兰州市: [103.5901, 36.3043],
包头市: [110.3467, 41.4899],
北京市: [116.4551, 40.2539],
北海市: [109.314, 21.6211],
南京市: [118.8062, 31.9208],
南宁市: [108.479, 23.1152],
南昌市: [116.0046, 28.6633],
南通市: [121.1023, 32.1625],
厦门市: [118.1689, 24.6478],
台州市: [121.1353, 28.6688],
合肥市: [117.29, 32.0581],
呼和浩特市: [111.4124, 40.4901],
咸阳市: [108.4131, 34.8706],
哈尔滨市: [127.9688, 45.368],
唐山市: [118.4766, 39.6826],
嘉兴市: [120.9155, 30.6354],
大同市: [113.7854, 39.8035],
大连市: [122.2229, 39.4409],
天津市: [117.4219, 39.4189],
太原市: [112.3352, 37.9413],
威海市: [121.9482, 37.1393],
宁波市: [121.5967, 29.6466],
宝鸡市: [107.1826, 34.3433],
宿迁市: [118.5535, 33.7775],
常州市: [119.4543, 31.5582],
广州市: [113.5107, 23.2196],
廊坊市: [116.521, 39.0509],
延安市: [109.1052, 36.4252],
张家口市: [115.1477, 40.8527],
徐州市: [117.5208, 34.3268],
德州市: [116.6858, 37.2107],
惠州市: [114.6204, 23.1647],
成都市: [103.9526, 30.7617],
扬州市: [119.4653, 32.8162],
承德市: [117.5757, 41.4075],
拉萨市: [91.1865, 30.1465],
无锡市: [120.3442, 31.5527],
日照市: [119.2786, 35.5023],
昆明市: [102.9199, 25.4663],
杭州市: [119.5313, 29.8773],
枣庄市: [117.323, 34.8926],
柳州市: [109.3799, 24.9774],
株洲市: [113.5327, 27.0319],
武汉市: [114.3896, 30.6628],
汕头市: [117.1692, 23.3405],
江门市: [112.6318, 22.1484],
沈阳市: [123.1238, 42.1216],
沧州市: [116.8286, 38.2104],
河源市: [114.917, 23.9722],
泉州市: [118.3228, 25.1147],
泰安市: [117.0264, 36.0516],
泰州市: [120.0586, 32.5525],
济南市: [117.1582, 36.8701],
济宁市: [116.8286, 35.3375],
海口市: [110.3893, 19.8516],
淄博市: [118.0371, 36.6064],
淮安市: [118.927, 33.4039],
深圳市: [114.5435, 22.5439],
清远市: [112.9175, 24.3292],
温州市: [120.498, 27.8119],
渭南市: [109.7864, 35.0299],
湖州市: [119.8608, 30.7782],
湘潭市: [112.5439, 27.7075],
滨州市: [117.8174, 37.4963],
潍坊市: [119.0918, 36.524],
烟台市: [120.7397, 37.5128],
玉溪市: [101.9312, 23.8898],
珠海市: [113.7305, 22.1155],
盐城市: [120.2234, 33.5577],
盘锦市: [121.9482, 41.0449],
石家庄市: [114.4995, 38.1006],
福州市: [119.4543, 25.9222],
秦皇岛市: [119.2126, 40.0232],
绍兴市: [120.564, 29.7565],
聊城市: [115.9167, 36.4032],
肇庆市: [112.1265, 23.5822],
舟山市: [122.2559, 30.2234],
苏州市: [120.6519, 31.3989],
莱芜市: [117.6526, 36.2714],
菏泽市: [115.6201, 35.2057],
营口市: [122.4316, 40.4297],
葫芦岛市: [120.1575, 40.578],
衡水市: [115.8838, 37.7161],
衢州市: [118.6853, 28.8666],
西宁市: [101.4038, 36.8207],
西安市: [109.1162, 34.2004],
贵阳市: [106.6992, 26.7682],
连云港市: [119.1248, 34.552],
邢台市: [114.8071, 37.2821],
邯郸市: [114.4775, 36.535],
郑州市: [113.4668, 34.6234],
鄂尔多斯市: [108.9734, 39.2487],
重庆市: [107.7539, 30.1904],
金华市: [120.0037, 29.1028],
铜川市: [109.0393, 35.1947],
银川市: [106.3586, 38.1775],
镇江市: [119.4763, 31.9702],
长春市: [125.8154, 44.2584],
长沙市: [113.0823, 28.2568],
长治市: [112.8625, 36.4746],
阳泉市: [113.4778, 38.0951],
青岛市: [120.4651, 36.3373],
韶关市: [113.7964, 24.7028]
};*/
let geoCoordMap = conversionCity;
let planePath =
"path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z";
export default {
name: "widgetLineMap",
props: {
value: Object,
ispreview: Boolean
},
data() {
return {
options: {
title: {
left: "center",
textStyle: {
color: "#fff"
}
},
tooltip: {
trigger: 'item',
formatter: function (params, ticket, callback) {
if (params.seriesType == "effectScatter") {
return "线路:" + params.data.name + "" + params.data.value[2];
} else if (params.seriesType == "lines") {
return params.data.fromName + ">" + params.data.toName + "<br />" + params.data.value;
} else {
return params.name;
}
}
},
legend: {
show: true,
orient: 'vertical',
top: 'bottom',
left: 'right',
textStyle: {
color: '#fff'
},
selectedMode: 'multiple',
},
geo: {
map: "china",
label: {
emphasis: {
show: true,
color: "white"
}
},
roam: true,
itemStyle: {
normal: {
areaColor: "#323c48",
borderColor: "#404a59",
borderWidth: 1,
},
emphasis: {
areaColor: "#2a333d"
}
},
},
series: [
{
//name: tempData[0],
type: "lines",
zlevel: 1,
effect: {
show: false,
period: 6,
trailLength: 0.7,
color: "#fff",
symbolSize: 3
},
lineStyle: {
normal: {
color: '#a6c84c',
width: 0,
curveness: 0.2
}
},
data: [],
},
{
type: "lines",
zlevel: 2,
symbol: ['none', 'arrow'],
symbolSize: 10,
effect: {
show: true,
period: 4,
trailLength: 0,
symbol: 'arrow',
symbolSize: 5
},
lineStyle: {
normal: {
// + 线
color: '#ffa022',
width: 1,
opacity: 0.4,
curveness: 0.2
}
},
data: [],
},
{
//
//name: tempData[0],
type: 'effectScatter',
coordinateSystem: 'geo',
zlevel: 2,
rippleEffect: {
brushType: 'stroke'
},
label: {
normal: {
show: true,
position: 'right',
formatter: '{b}',
fontSize: 22,
}
},
//
symbolSize: 10,
itemStyle: {
normal: {
//
color: '#46bee9'
}
},
data: [],
},
{
//
//name: tempData[0],
type: 'effectScatter',
coordinateSystem: 'geo',
zlevel: 2,
rippleEffect: {
brushType: 'stroke'
},
label: {
normal: {
show: true,
position: 'right',
formatter: '{b}',
fontSize: 22,
}
},
//
symbolSize: 10,
itemStyle: {
normal: {
//
color: '#46bee9'
}
},
data: [],
},
]
},
optionsSetup: {}
};
},
computed: {
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
background: this.optionsSetup.background
};
}
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
this.optionsData = val.data;
this.optionsSetup = val.setup;
this.editorOptions();
},
deep: true
}
},
created() {
this.optionsStyle = this.value.position;
this.optionsData = this.value.data;
this.optionsSetup = this.value.setup;
},
mounted() {
this.editorOptions();
},
methods: {
convertData(data) {
let res = [];
for (let i = 0; i < data.length; i++) {
let dataItem = data[i];
let sourceCoord = geoCoordMap[dataItem.source];
let targetCoord = geoCoordMap[dataItem.target];
if (sourceCoord && targetCoord) {
res.push({
fromName: dataItem.source,
toName: dataItem.target,
coords: [sourceCoord, targetCoord],
value: dataItem.value,
}
)
}
;
}
return res;
},
editorOptions() {
this.setOptionsTitle();
this.setOptionsSource();
this.setOptionsTarget();
this.setOptionsSymbol();
this.setOptionsLine();
this.setOptionsColor();
this.setOptionsData();
},
//
setOptionsTitle() {
const optionsSetup = this.optionsSetup;
const title = {};
title.show = optionsSetup.isNoTitle;
title.text = optionsSetup.titleText;
title.left = optionsSetup.textAlign;
title.textStyle = {
color: optionsSetup.textColor,
fontSize: optionsSetup.textFontSize,
fontWeight: optionsSetup.textFontWeight
};
title.subtext = optionsSetup.subText;
title.subtextStyle = {
color: optionsSetup.subTextColor,
fontWeight: optionsSetup.subTextFontWeight,
fontSize: optionsSetup.subTextFontSize
};
this.options.title = title;
},
//
setOptionsSource(){
const optionsSetup = this.optionsSetup;
const series = this.options.series[2];
const normal = {
show: optionsSetup.isShowSource,
position: 'right',
color: optionsSetup.sourceFontTextColor,
fontSize: optionsSetup.sourceFontTextSize,
fontWeight: optionsSetup.sourceFontTextWeight,
};
const itemStyle = {
normal: {
color: optionsSetup.sourcePointColor,
}
};
series.symbolSize = optionsSetup.sourceSymbolSize;
series.label.normal = normal;
series.itemStyle = itemStyle;
},
//
setOptionsTarget(){
const optionsSetup = this.optionsSetup;
const series = this.options.series[3];
const normal = {
show: optionsSetup.isShowTarget,
position: 'right',
color: optionsSetup.targetFontTextColor,
fontSize: optionsSetup.targetFontTextSize,
fontWeight: optionsSetup.targetFontTextWeight,
};
const itemStyle = {
normal: {
color: optionsSetup.targetPointColor,
}
};
series.symbolSize = optionsSetup.targetSymbolSize;
series.label.normal = normal;
series.itemStyle = itemStyle;
},
//
setOptionsSymbol(){
const optionsSetup = this.optionsSetup;
const series = this.options.series[1];
const effect = {
show: true,
period: this.setPeriod(optionsSetup),
trailLength: 0,
symbol: this.setSymbol(optionsSetup),
symbolSize: optionsSetup.symbolSize,
color: optionsSetup.symbolColor,
};
series['effect'] = effect;
},
setSymbol(optionsSetup) {
let symbol;
if (optionsSetup.symbol == 'plane') {
symbol = planePath;
} else {
symbol = "arrow";
}
return symbol;
},
setPeriod(optionsSetup){
let period;
if (optionsSetup.symbol == 'plane') {
period = optionsSetup.symbolPeriod - 1;
}else {
period = optionsSetup.symbolPeriod;
}
return period;
},
// 线
setOptionsLine() {
const optionsSetup = this.optionsSetup;
const series = this.options.series[1];
const lineStyle = {
normal: {
// 线
color: optionsSetup.lineColor,
width: optionsSetup.lineWidth,
opacity: 0.4,
curveness: 0.2
}
};
series['lineStyle'] = lineStyle;
},
//
setOptionsColor() {
const optionsSetup = this.optionsSetup;
const itemStyle = {
normal: {
//
areaColor: optionsSetup.blockColor,
borderColor: optionsSetup.borderColor,
},
emphasis: {
//
areaColor: optionsSetup.highlightColor,
}
};
this.options.geo["itemStyle"] = itemStyle;
},
//
setOptionsData() {
const optionsData = this.optionsData; // or
optionsData.dataType == "staticData"
? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
},
staticDataFn(val) {
const series = this.options.series;
series[0]["data"] = this.convertData(val);
series[1]["data"] = this.convertData(val);
series[2]["data"] = val.map(function (dataItem) {
if (geoCoordMap[dataItem.source] && geoCoordMap[dataItem.target]) {
return {
name: dataItem.source,
value: geoCoordMap[dataItem.source].concat([dataItem.value])
}
}
});
series[3]["data"] = val.map(function (dataItem) {
if (geoCoordMap[dataItem.source] && geoCoordMap[dataItem.target]) {
return {
name: dataItem.target,
value: geoCoordMap[dataItem.target].concat([dataItem.value])
}
}
});
},
dynamicDataFn(val, refreshTime) {
if (!val) return;
if (this.ispreview) {
this.getEchartData(val);
this.flagInter = setInterval(() => {
this.getEchartData(val);
}, refreshTime);
} else {
this.getEchartData(val);
}
},
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then(res => {
this.renderingFn(res);
});
},
renderingFn(val) {
const series = this.options.series;
series[0]["data"] = this.convertData(val);
series[1]["data"] = this.convertData(val);
series[2]["data"] = val.map(function (dataItem) {
if (geoCoordMap[dataItem.source] && geoCoordMap[dataItem.target]) {
return {
name: dataItem.source,
value: geoCoordMap[dataItem.source].concat([dataItem.value])
}
}
});
series[3]["data"] = val.map(function (dataItem) {
if (geoCoordMap[dataItem.source] && geoCoordMap[dataItem.target]) {
return {
name: dataItem.target,
value: geoCoordMap[dataItem.target].concat([dataItem.value])
}
}
});
}
}
};
</script>
<style lang="scss" scoped>
.echartMap {
width: 100%;
height: 100%;
}
.echarts {
width: 100%;
height: 100%;
overflow: hidden;
}
</style>

@ -1,468 +0,0 @@
<template>
<div :style="styleObj">
<v-chart :options="options" autoresize />
</div>
</template>
<script>
import "../../../../../node_modules/echarts/map/js/china.js";
let GZData = [
[
{
name: "广州"
},
{
name: "福州",
value: 95
}
],
[
{
name: "广州"
},
{
name: "太原",
value: 90
}
],
[
{
name: "广州"
},
{
name: "长春",
value: 80
}
],
[
{
name: "广州"
},
{
name: "重庆",
value: 70
}
],
[
{
name: "广州"
},
{
name: "西安",
value: 60
}
],
[
{
name: "广州"
},
{
name: "成都",
value: 50
}
],
[
{
name: "广州"
},
{
name: "常州",
value: 40
}
],
[
{
name: "广州"
},
{
name: "北京",
value: 30
}
],
[
{
name: "广州"
},
{
name: "北海",
value: 20
}
],
[
{
name: "广州"
},
{
name: "海口",
value: 10
}
]
];
let geoCoordMap = {
上海: [121.4648, 31.2891],
东莞: [113.8953, 22.901],
东营: [118.7073, 37.5513],
中山: [113.4229, 22.478],
临汾: [111.4783, 36.1615],
临沂: [118.3118, 35.2936],
丹东: [124.541, 40.4242],
丽水: [119.5642, 28.1854],
乌鲁木齐: [87.9236, 43.5883],
佛山: [112.8955, 23.1097],
保定: [115.0488, 39.0948],
兰州: [103.5901, 36.3043],
包头: [110.3467, 41.4899],
北京: [116.4551, 40.2539],
北海: [109.314, 21.6211],
南京: [118.8062, 31.9208],
南宁: [108.479, 23.1152],
南昌: [116.0046, 28.6633],
南通: [121.1023, 32.1625],
厦门: [118.1689, 24.6478],
台州: [121.1353, 28.6688],
合肥: [117.29, 32.0581],
呼和浩特: [111.4124, 40.4901],
咸阳: [108.4131, 34.8706],
哈尔滨: [127.9688, 45.368],
唐山: [118.4766, 39.6826],
嘉兴: [120.9155, 30.6354],
大同: [113.7854, 39.8035],
大连: [122.2229, 39.4409],
天津: [117.4219, 39.4189],
太原: [112.3352, 37.9413],
威海: [121.9482, 37.1393],
宁波: [121.5967, 29.6466],
宝鸡: [107.1826, 34.3433],
宿迁: [118.5535, 33.7775],
常州: [119.4543, 31.5582],
广州: [113.5107, 23.2196],
廊坊: [116.521, 39.0509],
延安: [109.1052, 36.4252],
张家口: [115.1477, 40.8527],
徐州: [117.5208, 34.3268],
德州: [116.6858, 37.2107],
惠州: [114.6204, 23.1647],
成都: [103.9526, 30.7617],
扬州: [119.4653, 32.8162],
承德: [117.5757, 41.4075],
拉萨: [91.1865, 30.1465],
无锡: [120.3442, 31.5527],
日照: [119.2786, 35.5023],
昆明: [102.9199, 25.4663],
杭州: [119.5313, 29.8773],
枣庄: [117.323, 34.8926],
柳州: [109.3799, 24.9774],
株洲: [113.5327, 27.0319],
武汉: [114.3896, 30.6628],
汕头: [117.1692, 23.3405],
江门: [112.6318, 22.1484],
沈阳: [123.1238, 42.1216],
沧州: [116.8286, 38.2104],
河源: [114.917, 23.9722],
泉州: [118.3228, 25.1147],
泰安: [117.0264, 36.0516],
泰州: [120.0586, 32.5525],
济南: [117.1582, 36.8701],
济宁: [116.8286, 35.3375],
海口: [110.3893, 19.8516],
淄博: [118.0371, 36.6064],
淮安: [118.927, 33.4039],
深圳: [114.5435, 22.5439],
清远: [112.9175, 24.3292],
温州: [120.498, 27.8119],
渭南: [109.7864, 35.0299],
湖州: [119.8608, 30.7782],
湘潭: [112.5439, 27.7075],
滨州: [117.8174, 37.4963],
潍坊: [119.0918, 36.524],
烟台: [120.7397, 37.5128],
玉溪: [101.9312, 23.8898],
珠海: [113.7305, 22.1155],
盐城: [120.2234, 33.5577],
盘锦: [121.9482, 41.0449],
石家庄: [114.4995, 38.1006],
福州: [119.4543, 25.9222],
秦皇岛: [119.2126, 40.0232],
绍兴: [120.564, 29.7565],
聊城: [115.9167, 36.4032],
肇庆: [112.1265, 23.5822],
舟山: [122.2559, 30.2234],
苏州: [120.6519, 31.3989],
莱芜: [117.6526, 36.2714],
菏泽: [115.6201, 35.2057],
营口: [122.4316, 40.4297],
葫芦岛: [120.1575, 40.578],
衡水: [115.8838, 37.7161],
衢州: [118.6853, 28.8666],
西宁: [101.4038, 36.8207],
西安: [109.1162, 34.2004],
贵阳: [106.6992, 26.7682],
连云港: [119.1248, 34.552],
邢台: [114.8071, 37.2821],
邯郸: [114.4775, 36.535],
郑州: [113.4668, 34.6234],
鄂尔多斯: [108.9734, 39.2487],
重庆: [107.7539, 30.1904],
金华: [120.0037, 29.1028],
铜川: [109.0393, 35.1947],
银川: [106.3586, 38.1775],
镇江: [119.4763, 31.9702],
长春: [125.8154, 44.2584],
长沙: [113.0823, 28.2568],
长治: [112.8625, 36.4746],
阳泉: [113.4778, 38.0951],
青岛: [120.4651, 36.3373],
韶关: [113.7964, 24.7028]
};
let type = "流出";
let color = ["#a6c84c", "#ffa022", "#46bee9"];
let tempData = ["广州", GZData];
let planePath =
"path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z";
export default {
name: "widgetMap",
props: {
value: Object,
ispreview: Boolean
},
data() {
return {
options: {
title: {
text: "模拟迁徙",
subtext: "数据纯属虚构",
left: "center",
textStyle: {
color: "#fff"
}
},
tooltip: {
trigger: "item",
formatter: function(params) {
console.log(params);
if (params.seriesType == "effectScatter") {
if ("流入" == type) {
return (
type +
"<br>" +
params.data.name +
" ---> " +
params.seriesName +
"<br />人数:" +
params.data.value[2] +
"人"
);
} else {
return (
"流出<br>" +
params.seriesName +
" ---> " +
params.data.name +
"<br />人数:" +
params.data.value[2] +
"人"
);
}
} else if (params.seriesType == "lines") {
if ("流入" == type) {
return (
type +
"<br>" +
params.data.toName +
" ---> " +
params.data.fromName +
"<br />人数:" +
params.data.value +
"人"
);
} else {
return (
type +
"<br>" +
params.data.fromName +
" ---> " +
params.data.toName +
"<br />人数:" +
params.data.value +
"人"
);
}
} else {
return params.name;
}
}
},
legend: {
show: false,
orient: "vertical",
top: "bottom",
left: "right",
data: ["广州"],
textStyle: {
color: "#fff"
},
selectedMode: "single"
},
geo: {
map: "china",
label: {
emphasis: {
//show: false,
show: true,
color: "white"
}
},
roam: true,
itemStyle: {
normal: {
areaColor: "#323c48",
borderColor: "#404a59"
},
emphasis: {
areaColor: "#2a333d"
}
}
},
series: []
},
optionsSetup: {}
};
},
computed: {
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
background: this.optionsSetup.background
};
}
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
},
deep: true
}
},
created() {
this.optionsStyle = this.value.position;
},
mounted() {
this.initData();
},
methods: {
initData() {
const options = this.options;
options.series.push(
{
name: tempData[0],
type: "lines",
zlevel: 1,
effect: {
show: true,
period: 6,
trailLength: 0.7,
color: "#fff",
symbolSize: 3
},
lineStyle: {
normal: {
color: color[0],
width: 0,
curveness: 0.2
}
},
data: this.convertData(tempData[1])
},
{
name: tempData[0],
type: "lines",
zlevel: 2,
effect: {
show: true,
period: 6,
trailLength: 0,
symbol: planePath,
symbolSize: 15
},
lineStyle: {
normal: {
color: color[0],
width: 1,
opacity: 0.4,
curveness: 0.2
}
},
data: this.convertData(tempData[1])
},
{
name: tempData[0],
type: "effectScatter",
coordinateSystem: "geo",
zlevel: 2,
rippleEffect: {
brushType: "stroke"
},
label: {
normal: {
show: true,
position: "right",
formatter: "{b}"
}
},
symbolSize: function(val) {
return val[2] / 8;
},
itemStyle: {
normal: {
color: color[0]
}
},
data: tempData[1].map(function(dataItem) {
return {
name: dataItem[1].name,
value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
};
})
}
);
this.options = options;
},
convertData(data) {
let res = [];
for (let i = 0; i < data.length; i++) {
let dataItem = data[i];
let fromCoord = geoCoordMap[dataItem[0].name];
let toCoord = geoCoordMap[dataItem[1].name];
if ("流入" == type) {
fromCoord = geoCoordMap[dataItem[1].name];
toCoord = geoCoordMap[dataItem[0].name];
}
if (fromCoord && toCoord) {
res.push({
fromName: dataItem[0].name,
toName: dataItem[1].name,
coords: [fromCoord, toCoord],
value: dataItem[1].value
});
}
}
return res;
}
}
};
</script>
<style lang="scss" scoped>
.echartMap {
width: 100%;
height: 100%;
}
.echarts {
width: 100%;
height: 100%;
overflow: hidden;
}
</style>

@ -94,11 +94,11 @@ export default {
}, },
formatWeek(date, fmt) { formatWeek(date, fmt) {
const year = date.getFullYear(); const year = date.getFullYear();
const month = date.getMonth() + 1; const month = this.check(date.getMonth() + 1);
const day = date.getDate(); const day = this.check(date.getDate());
const hours = date.getHours(); const hours = this.check(date.getHours());
const minutes = date.getMinutes(); const minutes = this.check(date.getMinutes());
const seconds = date.getSeconds(); const seconds = this.check(date.getSeconds());
let dayCycle = date.getDay(); let dayCycle = date.getDay();
const dayCycleArray = ["日", "一", "二", "三", "四", "五", "六"]; const dayCycleArray = ["日", "一", "二", "三", "四", "五", "六"];
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {

Loading…
Cancel
Save