123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858 |
- <template>
- <!-- 这是我的页面 -->
- <div>
- <div class="autoBox box countryBox">
- <div class="crumbs">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item :to="{ path: 'home' }">{{
- $t('common.Home')
- }}</el-breadcrumb-item>
- <el-breadcrumb-item>{{
- $t('common.CountryInformation')
- }}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <!-- 查询 -->
- <div>
- <div style="float: left; margin-top: 35px; margin-left: 140px">
- <span
- style="
- font-family: Microsoft YaHei, Arial, helvetica, neue, sans-serif;
- color: rgb(58, 98, 149);
- font-size: 24px;
- "
- >{{ $t('common.CountrySearch') }}</span
- >
- </div>
- <div style="margin-top: 15px; margin-left: 270px">
- <el-select
- v-model="input3"
- :no-match-text="$i18n.locale == 'zh' ? '无匹配数据' : 'No Data'"
- filterable
- :placeholder="$t('common.PleaseEnter') + $t('common.Nameofcountry')"
- style="width: 800px; height: 60px; margin-top: 20px"
- >
- <el-option
- v-for="item in options"
- :key="item.baseEntityId"
- :label="$i18n.locale == 'en' ? item.enName : item.zhName"
- :value="item.baseEntityId"
- @click.native="toViewDetail('countryNationalSpace', input3)"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <!-- 地图区域 -->
- <!-- <div style="height: 620px;width:100%;margin-top: 40px;position: relative;" class="map">
- <div class='chart' id='chart'></div>
- </div> -->
- <div>
- <div class="countryTitle" style="position: relative">
- <div
- style="
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- color: #fafafa;
- font-weight: 600;
- font-size: 20px;
- "
- >
- <img
- :src="getIcons(screen1s[screen1sIndex].value, index)"
- alt=""
- style="margin-right: 10px; vertical-align: middle"
- />
- {{ screen1s[screen1sIndex].label }}
- </div>
- </div>
- <div
- class="message"
- id="message"
- style="width: 100%; min-height: 420px"
- >
- <div
- style="
- display: inline-block;
- height: 355px;
- width: 258px;
- border-radius: 10px;
- overflow: hidden;
- vertical-align: top;
- margin-right: 20px;
- border: 1px solid #d8d8d8;
- "
- >
- <ul>
- <li
- style="
- background: #2c558a;
- color: #ffffff;
- height: 50px;
- line-height: 50px;
- font-size: 20px;
- text-align: center;
- "
- v-if="this.$i18n.locale == 'zh'"
- >
- 国别总数 {{ options.length }}
- </li>
- <li
- style="
- background: #2c558a;
- color: #ffffff;
- height: 50px;
- line-height: 50px;
- font-size: 20px;
- text-align: center;
- "
- v-if="this.$i18n.locale == 'en'"
- >
- {{ options.length }} Countries
- </li>
- <li
- v-for="(item, index) in screen1s"
- class="li"
- :class="
- index == screen1sIndex ? 'color1 cursor' : 'color2 cursor'
- "
- @click="screen1sIndexChange(index)"
- >
- <img
- :src="getIcon(item.value, index)"
- alt=""
- style="width: 20px; height: 16px; margin-right: 10px"
- />
- <span>{{ item.label }}</span>
- </li>
- </ul>
- </div>
- <div
- style="
- width: 920px;
- min-height: 400px;
- display: inline-block;
- background: #f6fbff;
- color: #333333;
- "
- >
- <span
- :class="
- $i18n.locale == 'zh' ? 'countryListItem1' : 'countryListItem2'
- "
- class="countryActive cursor"
- @click="toView('countryNationalSpace', item.baseEntityId)"
- v-for="(item, index) in initData[screen1s[screen1sIndex].value]"
- >
- <span>{{
- $i18n.locale == 'zh' ? item.zhName : item.enName
- }}</span>
- </span>
- </div>
- </div>
- </div>
- <!-- 项目信息展示-->
- <div
- style="
- display: flex;
- justify-content: space-between;
- border-bottom: 2px solid #c9c6c6;
- padding: 0 30px;
- margin-top: 20px;
- "
- >
- <!-- 左侧信息-->
- <div style="display: inline-block; width: 46%">
- <div
- style="
- width: 100%;
- padding: 10px 0;
- border-bottom: 2px solid #2c558a;
- line-height: 50px;
- margin-left: 20px;
- "
- >
- {{ $t('common.ProjectTrends') }}
- <span
- @click="changeBatchToInfoData()"
- style="float: right; cursor: pointer"
- >
- <div style="width: 12px; height: 12px; float: left">
- <img
- src="@/assets/img/helpCenter/change1.png"
- alt=""
- style="width: 100%"
- />
- </div>
- <div
- style="
- float: left;
- margin-left: 5px;
- font-size: 16px;
- color: #778aa4;
- "
- >
- {{ $t('common.ChangeTheBatch') }}
- </div>
- </span>
- </div>
- <ul class="item messageList">
- <li
- v-for="item in infoData"
- @click="
- toViewDetail('projectPresentationDetails', item.projectId)
- "
- class="cursor list"
- >
- <div class="square"></div>
- <span class="title" v-text="item.projectName"></span>
- <span
- style="margin-left: 30px"
- v-text="formatDate(item.createDate)"
- ></span>
- </li>
- </ul>
- </div>
- <!-- 右侧信息-->
- <div style="display: inline-block; width: 46%; margin-right: 35px">
- <div
- style="
- padding: 10px 0;
- width: 100%;
- border-bottom: 2px solid #2c558a;
- line-height: 50px;
- margin-left: 20px;
- "
- >
- {{ $t('common.LatestDevelopment') }}
- <span
- @click="getInformation(listInformation.pageNo + 1)"
- style="float: right; cursor: pointer"
- >
- <div style="width: 12px; height: 12px; float: left">
- <img
- src="@/assets/img/helpCenter/change1.png"
- alt=""
- style="width: 100%"
- />
- </div>
- <div
- style="
- float: left;
- margin-left: 5px;
- font-size: 16px;
- color: #778aa4;
- "
- >
- {{ $t('common.ChangeTheBatch') }}
- </div>
- </span>
- </div>
- <ul class="item messageList">
- <li
- v-for="item in countryLastestInfos"
- @click="
- toViewDetail('countryInformationDetails', item.baseEntityId)
- "
- class="cursor list"
- >
- <div class="square"></div>
- <span class="title" v-text="item.title"></span>
- <span
- style="margin-left: 30px"
- v-text="formatDate(item.publishDate)"
- ></span>
- </li>
- </ul>
- </div>
- </div>
- <!-- 项目图片展示 -->
- <div
- style="
- width: 100%;
- display: flex;
- justify-content: space-between;
- margin-top: 30px;
- "
- >
- <div
- style="width: 22%; height: 150px"
- v-for="(item, index) in photo"
- :key="'img' + index"
- >
- <template v-if="index < 4">
- <img
- :src="'api/file/pub/' + item"
- alt=""
- style="width: 100%; height: 100%"
- />
- </template>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import HeaderItem from '@/components/headerItem'
- import tabers from '@/components/taber'
- import footers from '@/components/footers'
- import Screen from '@/components/screen'
- import {
- getCountryMap,
- getCountry,
- getCountryDynamicInfos,
- } from '@/api/country/countryList'
- import { getBaseProjectViews } from '@/api/project/baseProjectView'
- import echarts from 'echarts'
- import { getDicts } from '@/api/dict'
- export default {
- name: 'countryInformation',
- components: { tabers, HeaderItem, footers, Screen },
- data() {
- return {
- allDataList: [],
- pageChangeInformation: 0,
- listInformation: {
- pageNo: 1,
- pageSize: 5,
- language: '',
- },
- pageChange: 1,
- list: {
- pageNo: 1,
- pageSize: 5,
- language: '',
- continentCountry: '',
- technicalCategories: '',
- //0为默认排序,1为关注排序
- descStatus: 0,
- status: 1,
- },
- index: 1,
- input3: '',
- infoData: [],
- screen1sIndex: 0,
- countryList: [],
- initData: [],
- options: [],
- photo: [],
- screen1s: [],
- world: {
- nameMap: {},
- dataArr: [],
- },
- countryLastestInfos: [],
- shouldGetBegin: false,
- }
- },
- mounted() {
- this.setCountry()
- this.getInformation(1)
- this.getCountryKey()
- this.getInfor()
- let page = {
- language: this.$i18n.locale.toUpperCase(),
- }
- this.getCountryList(page)
- },
- watch: {
- '$i18n.locale'() {
- this.setCountry()
- this.getInformation(1)
- this.getInfor()
- this.getCountryKey()
- let page = {
- language: this.$i18n.locale.toUpperCase(),
- }
- this.getCountryList(page)
- },
- },
- methods: {
- getCountryKey() {
- getDicts(
- this.$i18n.locale == 'zh'
- ? 'CONTINENT_CODE_DICT,PROJECT_CATEGORIES_DICT,TECHNICAL_SCOPE_DICT'
- : 'CONTINENT_CODE_DICT_EN,PROJECT_CATEGORIES_DICT_EN,TECHNICAL_SCOPE_DICT_EN'
- ).then((result) => {
- var data = result.data
- if (data) {
- this.screen1s = result.data[0] || []
- }
- })
- },
- screen1sIndexChange(index) {
- this.screen1sIndex = index
- },
- getCountryList(page) {
- getCountry(page).then((res) => {
- console.log(res, '__________________________________________')
- if (res.data) {
- this.initData = res.data.areMap
- this.options = res.data.baseCountryViews
- } else {
- this.initData = []
- }
- })
- },
- getInformation(pageNo) {
- this.listInformation.language = this.$i18n.locale.toUpperCase()
- if (this.shouldGetBegin) {
- pageNo = 1
- }
- this.listInformation.pageNo = pageNo
- getCountryDynamicInfos(this.listInformation).then((res) => {
- var data = res.data
- if (data) {
- this.countryLastestInfos = data || []
- this.shouldGetBegin =
- this.countryLastestInfos.length < 5 ? true : false
- }
- })
- },
- changeBatchToInfoData() {
- this.pageChange += 1
- this.list.pageNo = this.pageChange + ''
- this.getInfor()
- },
- getInfor() {
- this.list.language = this.$i18n.locale.toUpperCase()
- getBaseProjectViews(this.list).then((res) => {
- if (res.data) {
- this.infoData = res.data.baseProjectViews
- res.data.allDataList.forEach((item) => {
- if (item.pictureUrl) {
- this.photo.push(item.pictureUrl)
- }
- })
- if (res.data.baseProjectViews.length < 5) {
- this.pageChange = 0
- }
- }
- })
- },
- showCountry(continent) {
- this.countryList = this.initData[continent] || []
- },
- getIconUrl(url) {
- return require('@/assets/img/home/' + url + '.png')
- },
- toViewDetail(router, json) {
- this.$store.commit('modify', router)
- window.localStorage.setItem('router', router)
- const { href } = this.$router.resolve({
- name: router,
- query: {
- key: json,
- },
- })
- window.open(href, '_blank')
- },
- toView(router, json) {
- // this.$router.push({name:router,query:{key:json}});
- this.$store.commit('modify', router)
- window.localStorage.setItem('router', router)
- const { href } = this.$router.resolve({
- name: router,
- query: {
- key: json,
- },
- })
- window.open(href, '_blank')
- },
- screenBack(data) {
- console.log(data, 'screenBackscreenBackscreenBackscreenBack')
- },
- screen(i) {
- this.index = i
- },
- setCountry() {
- let currentlang = this.$i18n.locale == 'zh' ? 'ZH' : 'EN'
- getCountryMap(currentlang).then((res) => {
- if (res.data) {
- this.world = res.data
- this.getWorldMap(res.data)
- }
- })
- },
- getWorldMap(data) {
- console.log(data, '地图数据')
- var namemap = data.nameMap
- var dataArr = data.dataArr
- console.log(namemap, dataArr, '自定义地图')
- for (let i = 0; i < dataArr.length; i++) {
- if (dataArr[i].id == '') {
- dataArr[i].value = 0
- } else {
- dataArr[i].value = 10
- }
- }
- this.drawChart(namemap, dataArr)
- },
- //获取对应的国家id
- getWorldByName(countryName) {
- for (let index in this.world.dataArr) {
- if (
- this.world.dataArr[index].name == countryName ||
- this.world.dataArr[index].countryNameEn == countryName
- ) {
- return this.world.dataArr[index].id
- }
- }
- },
- getIcon(value, index) {
- // return require("@/assets/img/country/countryIcon/" + value +'1.png');
- if (index == this.screen1sIndex) {
- return require('@/assets/img/country/countryIcon/' + value + '.png')
- } else {
- return require('@/assets/img/country/countryIcon/' + value + '1.png')
- }
- },
- getIcons(value, index) {
- return require('@/assets/img/country/countryIcon/' + value + '1.png')
- },
- drawChart(namemap, dataa) {
- console.log(dataa, '所有的地图数据,对应当前语言')
- // 基于准备好的dom,初始化echarts实例
- let chart = echarts.init(document.getElementById('chart'))
- let _this = this
- // 监听屏幕变化自动缩放图表
- // window.addEventListener('resize', function () {
- // chart.resize()
- // })
- // 绘制图表
- chart.setOption({
- // 提示框组件
- tooltip: {
- trigger: 'item',
- formatter: function (params) {
- if (_this.$i18n.locale == 'zh') {
- var res = params.name + '<br/>'
- for (var i = 0; i < 1; i++) {
- for (var j = 0; j < dataa.length; j++) {
- if (dataa[j].name == params.name) {
- res += '洲' + ': ' + dataa[j].continent
- }
- }
- }
- } else {
- var res = params.name + '<br/>'
- for (var i = 0; i < 1; i++) {
- for (var j = 0; j < dataa.length; j++) {
- if (dataa[j].name == params.name) {
- res += 'Continent' + ':' + dataa[j].continent
- }
- }
- }
- }
- return res
- },
- },
- visualMap: {
- min: 0,
- max: 10,
- text: ['min', 'max'],
- realtime: false,
- calculable: true,
- show: false,
- inRange: {
- color: ['#F0F0F0', '#318ed1'],
- },
- // data的值里有value时根据value有颜色变化,key只能是value,带不带引号都可以
- },
- series: [
- {
- // 系列名称,用于tooltip的显示,legend 的图例筛选 在 setOption 更新数据和配置项时用于指定对应的系列
- name: 'worldMap',
- // 类型
- type: 'map',
- // 地图类型
- mapType: 'world',
- // 是否开启鼠标缩放和平移漫游 默认不开启 如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move' 设置成 true 为都开启
- roam: false,
- // 图形上的文本标签
- label: {
- show: false, // 是否显示对应地名
- },
- zoom: 1.2,
- // 地图区域的多边形 图形样式
- itemStyle: {
- areaColor: '#318ed1',
- borderWidth: 0.5, // 描边线宽 为 0 时无描边
- borderColor: '#005897', // 图形的描边颜色 支持的颜色格式同 color,不支持回调函数
- borderType: 'solid', // 描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'
- },
- // 高亮状态下的多边形和标签样式
- emphasis: {
- label: {
- show: true, // 是否显示标签
- color: '#fff', // 文字的颜色 如果设置为 'auto',则为视觉映射得到的颜色,如系列色
- },
- itemStyle: {
- areaColor: '#FF6347', // 地图区域的颜色
- },
- },
- // 自定义地区的名称映射
- nameMap: namemap,
- // 地图系列中的数据内容数组 数组项可以为单个数值
- data: dataa,
- },
- ],
- })
- chart.on('click', { seriesName: 'worldMap' }, function (even) {
- console.log(even.data, 'even.data当前一条地图数据')
- let countryId = ''
- let countryName = even.data.name
- let id = _this.getWorldByName(countryName)
- if (id) {
- countryId = id
- }
- if (countryId !== '') {
- _this.$router.push({
- name: 'countryNationalSpace',
- query: { key: countryId },
- })
- } else {
- if (_this.$i18n.locale == 'en') {
- alert('No data available.')
- } else {
- alert('当前暂无数据。')
- }
- }
- })
- },
- },
- }
- </script>
- <style scoped>
- .whiteBox {
- position: absolute;
- left: 121px;
- height: 200px;
- background: #fff;
- width: 80px;
- bottom: 23px;
- }
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin-left: 20px;
- }
- body {
- margin: 0;
- }
- .countryInformation {
- width: 100%;
- height: 524px;
- margin-top: 10px;
- background-image: linear-gradient(#396db1, #4586da, #2c558a);
- /* background: url('../../assets/img/country/newMap.png') no-repeat; */
- /* background-size: 100%,100%; */
- position: relative;
- }
- .text {
- line-height: 35px;
- cursor: pointer;
- background-color: transparent;
- }
- #el-popover-4638 {
- background: #fff0;
- }
- .countryBox >>> .el-input__inner {
- height: 60px;
- }
- .countryBox >>> .el-input-group__append,
- .el-input-group__prepend {
- background: #2c558a;
- border-color: #2c558a;
- color: #fff;
- }
- .seamless-warp {
- height: 310px;
- overflow: hidden;
- }
- .el-button {
- background-color: transparent;
- border: 0;
- color: #fff;
- }
- .list {
- line-height: 45px;
- font-size: 14px;
- border-bottom: 2px dotted #d4d4d4;
- display: flex;
- align-items: center;
- }
- .list:hover {
- color: #ff0036;
- }
- .messageList {
- padding: 30px 20px;
- width: 100%;
- }
- .square {
- width: 8px;
- height: 8px;
- background: rgb(5, 91, 219);
- display: inline-block;
- margin-right: 10px;
- }
- .title {
- width: 390px;
- display: inline-block;
- height: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .mapMessage {
- color: #fff;
- font-size: 14px;
- cursor: pointer;
- position: relative;
- }
- .mapMessage::before {
- display: block;
- content: '【';
- font-size: 40px;
- position: absolute;
- left: -60px;
- top: -4px;
- opacity: 0;
- transition: all 0.8s;
- }
- .mapMessage::after {
- display: block;
- font-size: 40px;
- content: '】';
- position: absolute;
- right: -60px;
- top: -4px;
- opacity: 0;
- transition: all 0.8s;
- }
- .mapMessage:hover::before {
- left: -40px;
- opacity: 1;
- }
- .mapMessage:hover::after {
- right: -40px;
- opacity: 1;
- }
- .countryList {
- width: 200px;
- position: absolute;
- top: 20%;
- right: 0;
- border: 1px solid #ffffff6b;
- }
- .countryList ul > li {
- height: 30px;
- line-height: 30px;
- padding: 0 10px;
- color: #fff;
- cursor: pointer;
- }
- .map {
- position: relative;
- font-weight: 600;
- }
- .map span {
- cursor: pointer;
- }
- .my-tooltip {
- border-radius: 50px;
- background-color: rgba(106, 237, 247, 0.7);
- border: none;
- padding: 15px;
- color: #fff;
- font-size: 16px;
- }
- .inner-tag {
- width: 20px;
- height: 20px;
- background: #fff;
- border-radius: 50%;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- transition: all 0.5s;
- }
- .outer-tag:hover .inner-tag {
- width: 80px;
- height: 80px;
- opacity: 0;
- }
- /* 世界地图 */
- /*.chart {*/
- /* width: 80%;
- margin:0 auto;
- height: 600px;
- border: 1px solid #eeeeee; */
- /* background: url(../../public/static/bg.png) no-repeat; 背景图设置*/
- /* background-size: 100% 100%; */
- /* background:#FDFEFF #E2F4FF; */
- /* background:linear-gradient(top, #FDFEFF 0%, #E2F4FF 100%); */
- /*}*/
- .countryTitle {
- margin-top: 20px;
- width: 100%;
- height: 100px;
- background: #2d568a;
- }
- .countryListItem1 {
- width: 200px;
- height: 50px;
- float: left;
- text-align: center;
- margin: 20px 20px 0 0;
- /* overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis; */
- /* line-height: 50px; */
- }
- .countryListItem2 {
- width: 200px;
- height: 70px;
- float: left;
- text-align: center;
- margin: 20px 20px 0 0;
- /* overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis; */
- /* line-height: 50px; */
- }
- .message {
- width: 188px;
- float: left;
- margin-top: 10px;
- }
- .message .li {
- height: 50px;
- line-height: 50px;
- font-size: 20px;
- padding-left: 60px;
- border-bottom: 1px solid #d8d8d8;
- }
- .color1 {
- color: #0091ff;
- letter-spacing: 1px;
- }
- .color2 {
- color: #333333;
- letter-spacing: 1px;
- }
- .countryActive:hover {
- color: #0091ff;
- }
- </style>
|