import * as echarts from 'echarts'
import { Radar } from '@antv/g2plot'
import cq from '@/assets/js/cq.js'
import main9 from '@/assets/js/main9.js'
import dialogConfig from '@/views/BigScreen/js/DistrictReformDialogConfig.js'
import { mapState } from 'vuex'
import VueSeamlessScroll from 'vue-seamless-scroll'
import dialogComponents from '@/views/BigScreen/js/dialog_components.js'
import EasyDialog from '@/views/BigScreen/components/easy-dialog/index.vue'
import fakeData from '@/views/BigScreen/js/fakeData_district.js'
import apiList from '@/api/bigScreen/districView.js'
import bigScreenMixin from '@/mixins/bigScreenMixin.js'
import utils from '@/utils.js'
import screenHeader from '@/views/BigScreen/components/screenHeader.vue'
import dataMixin from '@/views/BigScreen/js/DistrictReformMethods.js'
import { size } from 'lodash'
export default {
name: 'DistrictReformMixin',
data() {
return {
eightIndex: [
{
name: '承接国家
试点项目数',
number: 0,
unit: '个',
comp: 'mapTarget_1'
},
{
name: '承接市级
试点项目数',
number: 0,
unit: '个',
comp: 'mapTarget_2'
},
{
name: '承接的国家和市级
试点按时通过验收率',
number: 0,
unit: '%',
comp: 'mapTarget_3'
},
{
name: '本年度新增国家
和市级试点项目数',
number: 0,
unit: '个',
comp: 'mapTarget_4'
},
{
name: '改革经验
获全国性肯定评价',
number: 0,
unit: '次',
comp: 'mapTarget_5'
},
{
name: '改革经验
获全市推广',
number: 0,
unit: '次',
comp: 'mapTarget_6'
},
{
name: '改革经验被5家中央
媒体深度专题报道',
number: 0,
unit: '次',
comp: 'mapTarget_7'
},
{
name: '社情民意
电话调查满意度',
number: 0,
unit: '%',
comp: 'mapTarget_8'
}
],
loadingColor: 'rgba(6, 46, 106, 0.01)',
loadObj: {
scrollListData1: false,
scrollListData2: false,
brandList: false,
pilotReform: false,
scrollBoradData: false,
scrollListDataBottom: false,
loadingMap: false,
},
ggbb_ssly: [],
showWorkPlat: false,
workPlatMenu: [],
currentTabComponent: '',
tableOptions: null,
dialogOption: {
dialogTitle: '',
width: '50%',
},
showEasy: false,
mapDialogShow: false,
mapDialogTop: 0,
mapDialogleft: 0,
// 地图分类颜色值
typeColor1: '#398C8F', // 优
typeColor2: '#1970c1', // 良
typeColor3: '#B0825C', // 一般
// 主城九区区域编码
main9Code: [
'500103000000',
'500112000000',
'500108000000',
'500106000000',
'500104000000',
'500107000000',
'500105000000',
'500113000000',
'500109000000',
],
currentMenu: {
name: '',
},
currentKey: 'DistrictReformView',
menuData: [],
activeBtn: 1,
activeBtnKey: 'composite',
myChartCQ: null,
myChartMain: null,
optionCQ: null,
optionMain: null,
// 单项指数排行榜
singleheader: [
{
name: '指数',
width: '33.33%',
},
{
name: '入榜区县',
width: '33.33%',
},
// {
// name: '得分',
// width: '25%',
// },
// {
// name: '全市排位', //放在区县名字前面展示
// width: '16%',
// },
{
name: '入榜形式', // 显示 蝉联冠军 新进冠军
width: '33.33%',
},
],
// 指数排行榜
scrollheader1: [
{
name: '区县',
width: '28%',
},
{
name: '得分',
width: '18%',
},
{
name: '区域排位',
width: '18%',
},
{
name: '全市排位',
width: '18%',
},
{
name: '区域变化',
width: '18%',
},
],
scrollListData1: [],
// 一地创新
scrollheader2: [
{
name: '区县',
width: '25%',
},
{
name: '获推广典型经验(条)',
width: '40%',
},
{
name: '排位',
width: '20%',
},
{
name: '变化',
width: '20%',
},
],
scrollListData2: [],
// 改革品牌
scrollheader3: [
{
name: '区县',
width: '20%',
},
{
name: '获全国肯定性
评价(次)',
width: '32%',
type: 'l',
},
{
name: '获中央媒体深度
专题报道(次)',
width: '33%',
type: 'l',
},
{
name: '排位',
width: '15%',
},
],
scrollListData3: [],
// 地图滚动数据
scrollBoradData: [
// {
// id: 1,
// name: '江津举办xx现场会',
// },
// {
// id: 2,
// name: '江津区陆海新通道打通xx一公里',
// },
// {
// id: 3,
// name: '沙坪坝区陆海新通道打通xx一公里',
// },
// {
// id: 4,
// name: '北碚区陆海新通道打通xx一公里',
// },
// {
// id: 5,
// name: '南岸区陆海新通道打通xx一公里',
// },
// {
// id: 6,
// name: '江津区陆海新通道打通xx一公里',
// },
// {
// id: 7,
// name: '北碚区陆海新通道打通xx一公里',
// },
],
// 指数排行榜
scrollheaderBottom: [
{
name: '区县',
width: '20%',
},
{
name: '提出需求',
width: '18%',
},
{
name: '转化为清单',
width: '24%',
},
{
name: '质效指数',
width: '18%',
},
{
name: '排名',
width: '20%',
},
],
scrollListDataBottom: [],
reformBrandData: [
{ time: '1月', value: 4, count: 1 },
{ time: '2月', value: 5, count: 2 },
{ time: '3月', value: 2, count: 4 },
{ time: '4月', value: 1, count: 3 },
{ time: '5月', value: 2, count: 1 },
{ time: '6月', value: 4, count: 4 },
],
reformBrandOption: null,
reformBrandChart: null,
reformData: null,
// 雷达 总书记指示
rayChart: null,
rayChartOption: null,
// 对接时 max设置为值的1.2倍
rayChartData: [
{
name: '经济和社会民生',
value: 60,
type: '习近平总书记重要指示批示、重要讲话精神',
},
{ name: '经济和社会民生', value: 70, type: '群众企业基层所盼' },
{ name: '经济和社会民生', value: 80, type: '其他省市先进经验' },
{
name: '文化',
value: 80,
type: '习近平总书记重要指示批示、重要讲话精神',
},
{ name: '文化', value: 70, type: '群众企业基层所盼' },
{ name: '文化', value: 60, type: '其他省市先进经验' },
{
name: '平安法治',
value: 40,
type: '习近平总书记重要指示批示、重要讲话精神',
},
{ name: '平安法治', value: 50, type: '群众企业基层所盼' },
{ name: '平安法治', value: 20, type: '其他省市先进经验' },
{
name: '民主法制',
value: 70,
type: '习近平总书记重要指示批示、重要讲话精神',
},
{ name: '民主法制', value: 40, type: '群众企业基层所盼' },
{ name: '民主法制', value: 10, type: '其他省市先进经验' },
{
name: '党建统领',
value: 60,
type: '习近平总书记重要指示批示、重要讲话精神',
},
{ name: '党建统领', value: 50, type: '群众企业基层所盼' },
{ name: '党建统领', value: 30, type: '其他省市先进经验' },
],
// 雷达 所属领域
rayChart2: null,
rayChartOption2: null,
// 对接时 max设置为值的1.2倍
rayChartData2: [
{ name: '经济和社会民生', value: 20, type: '国家级' },
{ name: '经济和社会民生', value: 120, type: '市级' },
{ name: '文化', value: 20, type: '国家级' },
{ name: '文化', value: 80, type: '市级' },
{ name: '平安法治', value: 18, type: '国家级' },
{ name: '平安法治', value: 78, type: '市级' },
{ name: '民主法制', value: 5, type: '国家级' },
{ name: '民主法制', value: 115, type: '市级' },
{ name: '党建统领', value: 10, type: '国家级' },
{ name: '党建统领', value: 70, type: '市级' },
],
// 部署时间
deployTimeChart: null,
deployTimeOption: null,
deployTimeData: [],
// 盼望
hopeChart: null,
hopeOption: null,
hopeData: [],
// 需求来源
quarterData: [
{
value: 1,
name: '一季度',
},
{ value: 2, name: '二季度' },
{ value: 3, name: '三季度' },
{ value: 4, name: '四季度' },
],
ggbb_lyqd: [],
heatBarChart: null,
heatBarOption: null,
legendBottom: [],
legendTop: [],
heatBarData: [],
//品牌榜chart数据
brandChartData1: [],
brandChartData2: [],
//改革试点成果
// 形成制度成果
achievement1: {
totalAchievement: 0,
gapQAchievement: 0,
},
// 搭建工作平台
achievement2: {
totalAchievement: 0,
gapQAchievement: 0,
},
// 上线应用场景
achievement3: {
totalAchievement: 0,
gapQAchievement: 0,
},
// 部署时间
deploymentTimeData: {},
deploymentTimeYear: [],
deploymentTimeData1: [],
deploymentTimeData2: [],
// 指数 单项
indexSingleData: [],
// 地图数据
compositeMapData: [],
workableMapData: [],
brandMapData: [],
satisfactionMapData: [],
riskMapData: [],
fxcd: [], //事件风险程度
quarter: null,
year: null,
currentQuarter: null
}
},
computed: {
...mapState({
frontMenus: (state) => {
return state.menu.frontMenus
},
}),
optionSingleHeightTime() {
return {
step: 0.1,
}
},
},
created() {
this.ggbb_ssly = utils.getDictItemsFromCache('ggbb_ssly')
this.ggbb_lyqd = utils.getDictItemsFromCache('ggbb_lyqd')
this.fxcd = utils.getDictItemsFromCache('fxcd')
},
mounted() {
this.nowQuarter()
let searchDate = sessionStorage.getItem('searchDate')
if (searchDate) {
searchDate = JSON.parse(searchDate)
this.year = searchDate.year
this.quarter = searchDate.quarter
} else {
this.checkQuarter()
}
this.$nextTick(() => {
this.initMapMain()
this.initMapCQ()
this.loadData('init')
})
this.$bus.$on('changeDate', (searchDate) => {
this.quarter = searchDate.quarter
this.year = searchDate.year
if (this.$route.path == '/DistrictReformView') {
this.loadData()
}
})
this.$root.$on('resize', () => {
this.resize(500)
})
},
beforeDestory() {
this.$bus.$off('changeDate')
let tooltip = document.querySelectorAll('.data-tooltip')
Array.from(tooltip).forEach((item) => {
item.remove()
})
},
methods: {
handleDetail(comp, type) {
this.$router.push({
path: '/DetailComponent',
name: 'DetailComponent',
query: {
comp,
type
}
})
},
getFileData(type) {
if (type == 'satisfaction') {
let data = this.qs.stringify({
year: this.year,
quarter: this.quarter,
})
apiList.satisfactionFile(data, (res) => {
if (res.satisfaction && res.satisfaction.id) {
this.openSubDialog('satisfactionReport', {
fileId: res.satisfaction.id
})
} else {
this.openSubDialog('satisfactionReport')
}
})
}
},
nowQuarter() {
let month = new Date().getMonth() + 1
if (month <= 3) {
this.currentQuarter = 1
} else if (month <= 6) {
this.currentQuarter = 2
} else if (month <= 9) {
this.currentQuarter = 3
} else if (month <= 12) {
this.currentQuarter = 4
}
},
checkQuarter() {
this.year = new Date().getFullYear()
let month = new Date().getMonth() + 1
if (month <= 3) {
this.quarter = 1
} else if (month <= 6) {
this.quarter = 2
} else if (month <= 9) {
this.quarter = 3
} else if (month <= 12) {
this.quarter = 4
}
},
goToSub(type) {
let data = {
ljxq: {
name: '两江新区',
code: '500191000000',
},
gxq: {
name: '高新区',
code: '500193000000',
},
}
this.$router.push({
path: '/DistrictReformSubView',
query: {
name: data[type].name,
code: data[type].code,
},
})
let tooltip = document.getElementsByClassName('data-tooltip')
Array.from(tooltip).forEach((item) => {
item.remove()
})
},
convertScatter(data, mapData, showTitle, key) {
let res = []
let tooltip
for (let i = 0; i < data.length; i++) {
let obj = data[i].properties
let color = '#081c47'
let find = mapData.find((item) => item.unitCode == obj.code)
if (find) {
let center = obj.center ? obj.center : obj.centroid
res.push([center[0], center[1], obj.name, find.eventData])
}
tooltip = {
className: 'data-tooltip',
show: true,
appendToBody: true,
backgroundColor: 'rgba(6, 47, 107, 1)',
borderColor: 'rgba(2, 115, 233, 1)',
textStyle: {
color: '#fff',
},
confine: true,
formatter: (data) => {
let eventData = []
if (data && data.value[3]) {
eventData = data.value[3]
}
let strE = ''
eventData.forEach((item) => {
let fxcd = this.getDictName('fxcd', item.riskLevel)
let ggfx_ywlb = this.getDictName(
'ggfx_ywlb',
item.riskType
)
strE += `