This commit is contained in:
asd
2020-11-20 17:15:30 +08:00
parent 9c5d503b51
commit 38aef23cca
29 changed files with 1647 additions and 1087 deletions

View File

@@ -2,4 +2,6 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'http://data.it-blog.wang/api/v1/' #VUE_APP_BASE_API = 'http://data.it-blog.wang/api/v1/'
#VUE_APP_BASE_API = 'http://abc.zhangjiwei.top/api/v1/'
VUE_APP_BASE_API = 'http://www.zhishidata.com/api/v1/'

View File

@@ -5,6 +5,58 @@
</div> </div>
</template> </template>
<script>
export default {
data () {
return {
// _beforeUnload_time:0,
// _gap_time:0,
}
},
mounted(){
// var that = this;
// window.addEventListener('beforeunload', e => that.beforeunloadHandler());
// window.addEventListener('unload', e => that.unloadHandler());
// window.onbeforeunload=function (){
// console.log(event)
// if(event.clientX>document.body.clientWidth && event.clientY < 0 || event.altKey){
// alert("你关闭了浏览器");
// }else{
// alert("你正在刷新页面");
// }
// }
},
methods:{
// beforeunloadHandler(){
// // return "故Aug阿U噶阿U噶"
// this._beforeUnload_time=new Date().getTime();
// console.log("777777");
// },
// unloadHandler(){
// // return "发挥的撒的女孩三等奖撒娇"
// // console.log("888888");
// this._gap_time=new Date().getTime()-this._beforeUnload_time;
// // console.log(this._gap_time,"1111111111111")
// //debugger
// //判断是窗口关闭还是刷新
// // if(this._gap_time<=5){
// // console.log("3333333333")
// // var xhr = new XMLHttpRequest();
// // xhr.open("GET",'http://localhost:8080/v1/member/index/logout?access-token='+sessionStorage.getItem('tokenB'), false);
// // xhr.setRequestHeader('Authorization','Bearer'+sessionStorage.getItem('token'))
// // xhr.send();
// // }else{
// // console.log("2222222222222")
// // }
// }
},
// destroyed() {
// let that = this;
// window.removeEventListener('beforeunload', e => that.beforeunloadHandler(e))
// window.removeEventListener('unload', e => that.unloadHandler(e))
// }
}
</script>
<style lang="scss"> <style lang="scss">
// 引入去掉浏览器默认样式css // 引入去掉浏览器默认样式css
@import './assets/css/selfSetCss.css'; @import './assets/css/selfSetCss.css';
@@ -23,3 +75,4 @@ background-color: rgba(0,0,0,0.5);
font-size: .75rem; font-size: .75rem;
} }
</style> </style>

View File

@@ -246,10 +246,12 @@ class computedFunc {
} }
// 处理input选中数据 // 处理input选中数据
inputSelectData (listArr, lineArr) { // listArr 列选中的数组 //line行选中的数组 inputSelectData (listArr, lineArr) { // listArr 列选中的数组 //line行选中的数组
// 重定向数组 // 重定向数组
let listArrs = JSON.parse(JSON.stringify(listArr)) let listArrs = JSON.parse(JSON.stringify(listArr))
let lineArrs = JSON.parse(JSON.stringify(lineArr)) let lineArrs = JSON.parse(JSON.stringify(lineArr))
listArrs.unshift(0) // 必选第一项 listArrs.unshift(0) // 必选第一项
if (this.restur.tableLine.length < listArrs.length) { if (this.restur.tableLine.length < listArrs.length) {
listArrs = this.restur.tableLine.map((item, index) => { listArrs = this.restur.tableLine.map((item, index) => {
return index return index
@@ -272,6 +274,7 @@ class computedFunc {
}) })
// this.selectData.tableLine = this.restur.tableLine // this.selectData.tableLine = this.restur.tableLine
let datart = JSON.parse(JSON.stringify(this.restur.countData)) let datart = JSON.parse(JSON.stringify(this.restur.countData))
let csd1 = datart.map((itemCol, indexCol) => { let csd1 = datart.map((itemCol, indexCol) => {
let newArr = {} let newArr = {}
Object.keys(itemCol).forEach((itemRow, indexRow) => { Object.keys(itemCol).forEach((itemRow, indexRow) => {
@@ -281,6 +284,7 @@ class computedFunc {
}) })
return newArr return newArr
}) })
this.selectData.countData = lineArrs.map((lineItem, lineIndex) => { this.selectData.countData = lineArrs.map((lineItem, lineIndex) => {
return csd1[lineItem] return csd1[lineItem]
}) })
@@ -519,7 +523,8 @@ class computedFunc {
dataSumLine () { dataSumLine () {
let dataRs = JSON.parse(JSON.stringify(this.restur)) let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({ dataRs.tableLine.push({
label: 'SUM求和' + this.restur.computedNum, // label: 'SUM求和' + this.restur.computedNum,
label: 'SUM求和',
labelId: 'table_line' + dataRs.tableLine.length labelId: 'table_line' + dataRs.tableLine.length
}) })
let bth = dataRs.countData.map((item, index) => { let bth = dataRs.countData.map((item, index) => {
@@ -556,7 +561,8 @@ class computedFunc {
let returObj = {} let returObj = {}
transSum.forEach((item, index) => { transSum.forEach((item, index) => {
if (index === 0) { if (index === 0) {
returObj['table_line' + index] = 'SUM求和' + this.restur.computedNum // returObj['table_line' + index] = 'SUM求和' + this.restur.computedNum
returObj['table_line' + index] = 'SUM求和'
} }
returObj['table_line' + (index + 1)] = item returObj['table_line' + (index + 1)] = item
}) })
@@ -1294,6 +1300,7 @@ class computedFunc {
shHangData = tableData.map((item, index) => { shHangData = tableData.map((item, index) => {
return Object.values(item) return Object.values(item)
}) })
console.log(5555)
let hangAllDatas = null let hangAllDatas = null
hangAllDatas = tableLine.map((item, index) => { hangAllDatas = tableLine.map((item, index) => {
return tableLine[index].label return tableLine[index].label

View File

@@ -10,10 +10,11 @@
style="width: 100%" style="width: 100%"
height="360px" height="360px"
ref="table"> ref="table">
<!-- :width="computedWidth(index)" -->
<el-table-column :prop="item.labelId" <el-table-column :prop="item.labelId"
:label="item.label" :label="item.label"
:fixed="index===0?true:false" :fixed="index===0?true:false"
:width="computedWidth(index)" width="190"
sortable sortable
show-overflow-tooltip show-overflow-tooltip
v-for="(item,index) in tableLine" v-for="(item,index) in tableLine"
@@ -50,13 +51,21 @@
:style="{'margin':indStatic===0?'0':''}" :style="{'margin':indStatic===0?'0':''}"
@click="indexExplain(scope.row['table_line0'])" /> @click="indexExplain(scope.row['table_line0'])" />
<!-- <span :style="{'color':(computedListSty(scope.$index)||computedLineSty(index))?'red':''}">{{scope.row['table_line'+index]}}</span> --> <!-- <span :style="{'color':(computedListSty(scope.$index)||computedLineSty(index))?'red':''}">{{scope.row['table_line'+index]}}</span> -->
<span>{{scope.row['table_line'+index]}}</span> <!-- <span>{{scope.row['table_line'+index]}}</span> -->
<!-- //颜色转变 -->
<!-- :style="{'color':(computedListSty(scope.$index)||computedLineSty(index))?'red':''}" -->
<span
>
<!-- {{isNaN(scope.row['table_line'+index])?:}} -->
{{isNaN(scope.row['table_line'+index])?scope.row['table_line'+index]:isNaN(parseFloat(scope.row['table_line'+index]))?'暂无数据':parseFloat(scope.row['table_line'+index])}}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 列表 表说明--> <!-- 列表 表说明-->
<div class="tableExplain" <div class="tableExplain" v-html="computedTableExplain" v-if="computedTableExplain"></div>
v-html="computedTableExplain"></div> <div class="tableExplain descnull" v-else >暂无数据</div>
<!-- 指标弹窗 --> <!-- 指标弹窗 -->
</div> </div>
<div v-if="!transBefore&&!loadings" <div v-if="!transBefore&&!loadings"
@@ -283,7 +292,7 @@ export default {
// 转置前总数据 // 转置前总数据
// transBefore: { // transBefore: {
// tableExplain: '', // tableExplain: '',
// timeArr: [], timeArr: [],
// termsName: [], // termsName: [],
// termsExplain: [], // termsExplain: [],
// areaName: [], // areaName: [],
@@ -408,7 +417,7 @@ export default {
// this.tableLine = [] // this.tableLine = []
// this.tableData = [] // this.tableData = []
} }
// this.$store.state.tableLine = this.tableLine this.$store.state.tableLine = this.tableLine
// console.log(this.tableLine, '指标数据') // console.log(this.tableLine, '指标数据')
}, },
immediate: true, immediate: true,
@@ -1762,6 +1771,14 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.descnull{
display: flex;
flex-direction: column;
justify-content: center;
font-size: 2rem;
text-align: center;
color: #ccc!important;
}
.tishi54 { .tishi54 {
margin-top: 12rem; margin-top: 12rem;
font-size: 2rem; font-size: 2rem;
@@ -1809,6 +1826,10 @@ export default {
/deep/ .cell > span { /deep/ .cell > span {
// white-space: nowrap; // white-space: nowrap;
flex-shrink: 0; flex-shrink: 0;
width: 145px;
// height: 100px;
overflow: hidden;
text-overflow: ellipsis;
} }
/deep/ .cell > span:hover { /deep/ .cell > span:hover {
cursor: pointer; cursor: pointer;

View File

@@ -566,12 +566,13 @@ export default {
this.childFuncChangeDown() this.childFuncChangeDown()
break break
case 'quarter': case 'quarter':
if (!(this.timeUsrr.length === 5 || this.timeUsrr.length === 11)) { console.log(this.timeUsrr,"111111111111111")
this.$alert('您查询的时间格式有误,请重新输入!', '温馨提示', { // if (!(this.timeUsrr.length === 5 || this.timeUsrr.length === 11)) {
confirmButtonText: '确定' // this.$alert('您查询的时间格式有误,请重新输入!', '温馨提示', {
}) // confirmButtonText: '确定'
return // })
} // return
// }
let arr = ['A', 'B', 'C', 'D'] let arr = ['A', 'B', 'C', 'D']
// 对于一个季度的验证 // 对于一个季度的验证
if (this.timeUsrr.length === 5) { if (this.timeUsrr.length === 5) {

View File

@@ -3,8 +3,8 @@
<div class="footer_header"> <div class="footer_header">
<div class="footer_model"> <div class="footer_model">
<div v-for="(item,index) in model_list" :key="index"> <div v-for="(item,index) in model_list" :key="index">
<div @click="skipTitle()" class="titleS">{{item.title}}</div> <div @click="skipTitle(item.titleUrl)" class="titleS">{{item.title}}</div>
<div v-for="(list,key) in item.cont" :key="key" @click="skipCont()">{{list.text}}</div> <div v-for="(list,key) in item.cont" :key="key" @click="skipCont(list.textUrl)">{{list.text}}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -12,10 +12,10 @@
<div class="bottom_model"> <div class="bottom_model">
<img :src="bottom_infor.leftImg" alt /> <img :src="bottom_infor.leftImg" alt />
<div>{{bottom_infor.introCopyright}}</div> <div>{{bottom_infor.introCopyright}}</div>
<div>{{bottom_infor.introSite}}</div> <!-- <div>{{bottom_infor.introSite}}</div>
<div>{{bottom_infor.introIdentificationCode}}</div> <div>{{bottom_infor.introIdentificationCode}}</div>
<div>{{bottom_infor.introAQ}}</div> <div>{{bottom_infor.introAQ}}</div>
<img :src="bottom_infor.rightImg" alt /> <img :src="bottom_infor.rightImg" alt /> -->
</div> </div>
</div> </div>
</div> </div>
@@ -63,20 +63,22 @@ export default {
// model_bottom 信息 // model_bottom 信息
bottom_infor: { bottom_infor: {
leftImg: require('../../../static/footerInfor/tbomleft.png'), leftImg: require('../../../static/footerInfor/tbomleft.png'),
introCopyright: '版权所有:中华人民共和国国家统计局 党政机关', introCopyright: 'Copyright 2020 河北知时数据科技有限公司 冀ICP备19011882',
introSite: '地址北京市西城区月坛南街57号100826', // introSite: '地址北京市西城区月坛南街57号100826',
introIdentificationCode: '网站标识码 bm36000005', // introIdentificationCode: '网站标识码 bm36000005',
introAQ: '京ICP备05034670号', // introAQ: '京ICP备05034670号',
rightImg: require('../../../static/footerInfor/tbomRight.png') // rightImg: require('../../../static/footerInfor/tbomRight.png')
} }
} }
}, },
methods: { methods: {
skipTitle () { skipTitle (e) {
console.log(e)
window.open("http://"+e,"_blank")
}, },
skipCont () { skipCont (e) {
console.log(e)
window.open("http://"+e,"_blank")
}, },
// 获取底部导航数据 // 获取底部导航数据
getNavBottomInfor () { getNavBottomInfor () {
@@ -104,6 +106,7 @@ export default {
arrts.push(objuu) arrts.push(objuu)
}) })
this.model_list = arrts this.model_list = arrts
console.log(this.model_list)
} }
}).catch((fail) => { }).catch((fail) => {
console.log(fail) console.log(fail)
@@ -261,10 +264,10 @@ export default {
-moz-box-direction: normal; -moz-box-direction: normal;
-ms-flex-direction: row; -ms-flex-direction: row;
flex-direction: row; flex-direction: row;
-webkit-justify-content: space-evenly; -webkit-justify-content: center;
-moz-box-pack: space-evenly; -moz-box-pack: center;
-ms-flex-pack: space-evenly; -ms-flex-pack: center;
justify-content: space-evenly; justify-content: center;
-webkit-align-items: center; -webkit-align-items: center;
-moz-box-align: center; -moz-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;

View File

@@ -1,5 +1,6 @@
<template> <template>
<div class="mapData"> <div class="mapData">
<!-- 左侧指标栏列表 -->
<div class="mapDataLeft" <div class="mapDataLeft"
v-if="leftDafrt"> v-if="leftDafrt">
<div v-if="leftDafrt.length!==0">指标名称</div> <div v-if="leftDafrt.length!==0">指标名称</div>
@@ -7,7 +8,10 @@
<div v-for="(item,index) in leftDafrt" <div v-for="(item,index) in leftDafrt"
:key="index" :key="index"
:class="{bgcolor:item.state}" :class="{bgcolor:item.state}"
@click="trickChange(index)">{{item.name}}</div> @click="trickChange(index)">
<div class="sanjiao"></div>
{{item.name}}
</div>
<div style="margin:0 auto;color:#8fa3ae;font-size:1.375rem;" <div style="margin:0 auto;color:#8fa3ae;font-size:1.375rem;"
v-if="leftDafrt.length===0">暂无指标名</div> v-if="leftDafrt.length===0">暂无指标名</div>
</div> </div>
@@ -27,10 +31,10 @@
<span :class="{'disable': !isReduceYear}" <span :class="{'disable': !isReduceYear}"
@click="reduceYear"></span> @click="reduceYear"></span>
</li> </li>
<li v-for="(year, index) in mapYearList.slice(yearStart,yearEnd)" <li v-for="(year, index) in mapYearList"
:key="index" :key="index"
:class="{'selected': selectYear == year}" :class="{'selected': selectYear == year}"
@click="selectYear=year"> @click="changeyear(year)">
{{ year }}<span v-if="selectYear == year"></span> {{ year }}<span v-if="selectYear == year"></span>
</li> </li>
<li class="next"> <li class="next">
@@ -39,10 +43,11 @@
</li> </li>
</ul> </ul>
<ul class="quarter"> <ul class="quarter">
<!-- @click="selectQuarter=index" -->
<li v-for="(item, index) in quarterList" <li v-for="(item, index) in quarterList"
:key="index" :key="index"
:class="{'selected': selectQuarter == index}" :class="{'selected': false}"
@click="selectQuarter=index"> >
{{ item }}<span v-if="selectQuarter == index"></span> {{ item }}<span v-if="selectQuarter == index"></span>
</li> </li>
</ul> </ul>
@@ -63,7 +68,9 @@ export default {
name: 'mapData', name: 'mapData',
data () { data () {
return { return {
datalist:{},
yearStart: '', yearStart: '',
arr:[],
yearEnd: '', yearEnd: '',
isReduceYear: true, isReduceYear: true,
isAddYear: false, isAddYear: false,
@@ -140,7 +147,7 @@ export default {
emphasis: { label: { show: true } } emphasis: { label: { show: true } }
}, },
data: [ data: [
{ name: '北京', value: Math.round(Math.random() * 1000) }, { name: '北京', value:100 },
{ name: '天津', value: Math.round(Math.random() * 1000) }, { name: '天津', value: Math.round(Math.random() * 1000) },
{ name: '上海', value: Math.round(Math.random() * 1000) }, { name: '上海', value: Math.round(Math.random() * 1000) },
{ name: '重庆', value: Math.round(Math.random() * 1000) }, { name: '重庆', value: Math.round(Math.random() * 1000) },
@@ -190,6 +197,7 @@ export default {
placeholder: '2019' placeholder: '2019'
} }
], ],
// 栏目数据 结构不可变 // 栏目数据 结构不可变
cityDataTime: [ cityDataTime: [
{ {
@@ -271,10 +279,40 @@ export default {
value: 'zhinan', value: 'zhinan',
label: '指南' label: '指南'
} }
] ],
// visualMap: {
// min: 800,
// max: 50000,
// text: ['High', 'Low'],
// realtime: false,
// calculable: true,
// inRange: {
// color: ['lightskyblue', 'yellow', 'orangered']
// }
// },
} }
}, },
methods: { methods: {
changeyear(e){
console.log(e,79464333333)
this.selectYear=e
for(let i=0;i<Object.keys(this.datalist).length;i++){
if(e == Object.keys(this.datalist)[i]){
console.log(i)
this.arr = this.datalist[Object.keys(this.datalist)[i]]
}
}
console.log(this.arr,'0000')
this.option.series[0].data = this.arr
// this.setMapLabel(
// this.arr
// )
this.option.dataRange.splitList = this.setMapLabel(
this.arr
)
this.showMapData()
},
// 获取左侧菜单数据 // 获取左侧菜单数据
getCateData () { getCateData () {
this.$axios({ this.$axios({
@@ -394,14 +432,14 @@ export default {
// this.showMapData() // this.showMapData()
}, },
changesInputStu () { changesInputStu () {
// console.log(12569) console.log(12569)
}, },
monthDataState (resu) { monthDataState (resu) {
// console.log(resu) console.log(resu)
// console.log(this.cityDefaultName) // console.log(this.cityDefaultName)
}, },
monthDataChange () { monthDataChange () {
// console.log(12569) console.log(12569)
}, },
// 地图左侧指标名称显示 // 地图左侧指标名称显示
searchDataMap () { searchDataMap () {
@@ -456,17 +494,29 @@ export default {
} }
}) })
.then(res => { .then(res => {
console.log(res, '数据地图数据') //console.log(res, '数据地图数据')
// 请求接口完成 请求成功 // 请求接口完成 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
this.datalist=res.data.data.list
this.initYearList()
console.log( console.log(
res.data.data.list, res.data.data.list,
'Object.values(res.data.data.list)' 'Object.values(res.data.data.list)'
) )
// 设置地图数值区间 // 设置地图数值区间
this.option.dataRange.splitList = this.setMapLabel( // this.option.dataRange.splitList = this.setMapLabel(
res.data.data.list // res.data.data.list
) // )
let year = ''
// for(let i=0;i<Object.keys(this.datalist).length;i++){
// // if(e == Object.keys(this.datalist)[i]){
// year= Object.keys(this.datalist)[i]
// // console.log(year)
// //}
// }
year= Object.keys(this.datalist)[0]
// console.log(year,"啊撒撒的撒打")
this.changeyear(year);
this.option.legend.data = [ this.option.legend.data = [
this.leftDafrt.find((item, index) => { this.leftDafrt.find((item, index) => {
return item.state === true return item.state === true
@@ -515,9 +565,12 @@ export default {
}, },
// 根据地图数值设置数值区间 // 根据地图数值设置数值区间
setMapLabel (data) { setMapLabel (data) {
// 数据地图显示的是当年的数据他把每年的数据分为6个阶段每个阶段都增加一个固定的值这个值的计算方式为当年各地区的最大数据减去最小数据 然后除以6 这个是每个阶段的增加的固定值,第一个区间是:最小值---最小值+固定值 第二区间为: 最小值+固定值----最小值+固定值+固定值,以此类推,最后一个为:最小值+固定值*5----最大值 console.log(data.length,'sssssssssss')
let max = 0 let max = 0
let min = 0 let min = 0
// 数据地图显示的是当年的数据他把每年的数据分为6个阶段每个阶段都增加一个固定的值这个值的计算方式为当年各地区的最大数据减去最小数据 然后除以6 这个是每个阶段的增加的固定值,第一个区间是:最小值---最小值+固定值 第二区间为: 最小值+固定值----最小值+固定值+固定值,以此类推,最后一个为:最小值+固定值*5----最大值
if(data.length == undefined){
for (let key in data) { for (let key in data) {
min = Number(data[key][0].value) min = Number(data[key][0].value)
} }
@@ -531,6 +584,21 @@ export default {
}) })
} }
console.log('最大值:' + max, '最小值:' + min) console.log('最大值:' + max, '最小值:' + min)
// for(let a=0;a<data.length;a++){
// if(data[a].name == "总计"){
// data = data.splice(a,1)
// console.log(data,'123456789')
// break
// }else if(data[a].name == "合计"){
// data = data.splice(a,1)
// console.log(data,'123456789')
// break
// }else{
// max = data[a].value > max ? parseFloat(data[a].value) : max
// min = data[a].value < min ? parseFloat(data[a].value) : min
// }
// }
let list = [{ start: 0, end: 1 }] let list = [{ start: 0, end: 1 }]
let temp = parseFloat(((max - min) / 6).toFixed(4)) let temp = parseFloat(((max - min) / 6).toFixed(4))
console.log(temp, '固定值') console.log(temp, '固定值')
@@ -538,7 +606,8 @@ export default {
i === 0 i === 0
? (list[i] = { ? (list[i] = {
start: parseFloat((min + temp * (5 - i)).toFixed(2)), start: parseFloat((min + temp * (5 - i)).toFixed(2)),
end: parseFloat(Math.ceil(max).toFixed(2)) // end: parseFloat(Math.ceil(max).toFixed(2))
end: parseFloat(max.toFixed(2))
}) })
: (list[i] = { : (list[i] = {
start: parseFloat((min + temp * (5 - i)).toFixed(2)), start: parseFloat((min + temp * (5 - i)).toFixed(2)),
@@ -547,6 +616,44 @@ export default {
} }
console.log(list, '区间列表') console.log(list, '区间列表')
return list return list
}else{
for(let a=0;a<data.length;a++){
if(data[a].name == "总计"){
data = data.splice(a,1)
console.log(data,'123456789')
break
}else if(data[a].name == "合计"){
data = data.splice(a,1)
console.log(data,'123456789')
break
}else{
max = data[a].value > max ? parseFloat(data[a].value) : max
min = data[a].value < min ? parseFloat(data[a].value) : min
}
}
console.log(max,min,'000000')
let list = [{ start: 0, end: 1 }]
let temp = parseFloat(((max - min) / 6).toFixed(4))
console.log(temp, '固定值')
for (let i = 0; i < 6; i++) {
i === 0
? (list[i] = {
start: parseFloat((min + temp * (5 - i)).toFixed(2)),
// end: parseFloat(Math.ceil(max).toFixed(2))
end: parseFloat(max.toFixed(2))
})
: (list[i] = {
start: parseFloat((min + temp * (5 - i)).toFixed(2)),
end: parseFloat((min + temp * (6 - i)).toFixed(2))
})
}
console.log(list, '区间列表')
return list
}
}, },
// 点击改变指标名称 // 点击改变指标名称
trickChange (ind) { trickChange (ind) {
@@ -564,22 +671,25 @@ export default {
this.showMapData() this.showMapData()
}, },
initYearList () { initYearList () {
const year = 2000 // console.log(this.datalist,'wsnbb')
// console.log(Object.keys(this.datalist)[0],"thisyaear")
const year = Object.keys(this.datalist)[0]
let arrYear = [] let arrYear = []
let thisYear = new Date().getFullYear() let thisYear = Object.keys(this.datalist)[ Object.keys(this.datalist).length-1]
var section = thisYear - year var section = thisYear - year
for (let i = 0; i <= section; i++) { for (let i = 0; i <= section; i++) {
arrYear.push(thisYear--) arrYear.push(thisYear--)
} }
this.yearEnd = arrYear.length this.yearEnd = arrYear[0]
this.yearStart = arrYear.length - 10 this.yearStart = arrYear.length-1
this.selectYear = arrYear[0] this.selectYear = arrYear[0]
this.mapYearList = arrYear.reverse() this.mapYearList = arrYear.reverse()
console.log(this.selectYear) //console.log(this.selectYear)
console.log(this.mapYearList) // console.log(this.mapYearList)
}, },
reduceYear () { reduceYear () {
// console.log(this.yearStart + '-' + this.yearEnd) // console.log(this.yearStart + '-' + this.yearEnd)
if (this.yearEnd - 10 > 0) { if (this.yearEnd - 10 > 0) {
this.yearEnd -= 1 this.yearEnd -= 1
this.yearStart = this.yearEnd - 10 this.yearStart = this.yearEnd - 10
@@ -611,7 +721,6 @@ export default {
}, },
mounted () { mounted () {
// 初始化年份列表 // 初始化年份列表
this.initYearList()
// 查询左侧数据 // 查询左侧数据
this.searchDataMap() this.searchDataMap()
// 获取菜单信息 // 获取菜单信息
@@ -625,6 +734,15 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sanjiao{
width: 0;
height: 0;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-left: 7px solid #007AFF;
margin-top:-2px!important;
margin-right:3px
}
/deep/ .el-col-24 { /deep/ .el-col-24 {
min-width: 100%; min-width: 100%;
width: auto; width: auto;
@@ -670,12 +788,14 @@ export default {
& > div { & > div {
padding-left: 10%; padding-left: 10%;
width: 90%; width: 90%;
height: 3.2rem; height: 2.5rem;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
font-size: 1.375rem; font-size: 14px;
// font-size: 1.375rem;
// background: red;
} }
& > div:hover { & > div:hover {
cursor: pointer; cursor: pointer;
@@ -753,6 +873,7 @@ export default {
bottom: 9px; bottom: 9px;
right: 23px; right: 23px;
cursor: pointer; cursor: pointer;
left: 10px;
} }
.disable { .disable {
background: url(../../../static/data/left-disable.jpg) no-repeat background: url(../../../static/data/left-disable.jpg) no-repeat
@@ -762,6 +883,7 @@ export default {
height: 11px; height: 11px;
bottom: 9px; bottom: 9px;
right: 23px; right: 23px;
left: 10px;
cursor: pointer; cursor: pointer;
} }
} }
@@ -773,7 +895,7 @@ export default {
width: 13px; width: 13px;
height: 11px; height: 11px;
bottom: 9px; bottom: 9px;
right: 23px; right: 10px;
cursor: pointer; cursor: pointer;
} }
.disable { .disable {
@@ -783,7 +905,7 @@ export default {
width: 13px; width: 13px;
height: 11px; height: 11px;
bottom: 9px; bottom: 9px;
right: 23px; right: 10px;
cursor: pointer; cursor: pointer;
} }
} }

View File

@@ -13,13 +13,13 @@
<div style="position:relative;"> <div style="position:relative;">
{{item.text}} {{item.text}}
<!-- 数据二级导航 --> <!-- 数据二级导航 -->
<div class="dataTwo" <!-- <div class="dataTwo"
v-if="twonav&&index===1"> v-if="twonav&&index===1">
<div @click="jumpData('monthly')">月度数据</div> <div @click="jumpData('monthly')">月度数据</div>
<div @click="jumpData('quarter')">季度数据</div> <div @click="jumpData('quarter')">季度数据</div>
<div @click="jumpData('year')">年度数据</div> <div @click="jumpData('year')">年度数据</div>
<div @click="jumpData('area')">地区数据</div> <div @click="jumpData('area')">地区数据</div>
</div> </div> -->
</div> </div>
</div> </div>
<div class="dsearch"> <div class="dsearch">
@@ -60,21 +60,25 @@
<div> <div>
<img :src="imageUrl.usernames" <img :src="imageUrl.usernames"
alt /> alt />
<input type="text" <!-- <input type="text"
placeholder="请输入用户名" placeholder="请输入用户名"
v-model="username" /> v-model="username" /> -->
<el-input v-model="username" placeholder="请输入用户名"></el-input>
</div> </div>
<div> <div>
<img :src="imageUrl.userpwds" <img :src="imageUrl.userpwds"
alt /> alt />
<input type="password" <!-- <input type="password"
placeholder="请输入密码" placeholder="请输入密码"
v-model="userpwd" /> v-model="userpwd" /> -->
<el-input v-model="userpwd" type="password" placeholder="请输入密码"></el-input>
</div> </div>
<div> <div>
<input type="text" <!-- <input type="text"
placeholder="请输入验证码" placeholder="请输入验证码"
v-model="useryzm" /> v-model="useryzm" /> -->
<el-input v-model="useryzm" border="none" placeholder="请输入验证码"></el-input>
<canvas ref="identifyDom" <canvas ref="identifyDom"
@click="get_identity()"></canvas> @click="get_identity()"></canvas>
</div> </div>
@@ -135,6 +139,7 @@ export default {
}, },
methods: { methods: {
navClick (indexs, url) { navClick (indexs, url) {
console.log(url);
if (indexs !== 1) { if (indexs !== 1) {
this.twonav = false this.twonav = false
this.colorD = false this.colorD = false
@@ -147,6 +152,9 @@ export default {
path: url path: url
}) })
} }
}else{
this.jumpData('monthly')
localStorage.setItem("active",0)
} }
}, },
navMouseClick (indexs, url, statics) { navMouseClick (indexs, url, statics) {
@@ -219,7 +227,8 @@ export default {
} }
}) })
.then(res => { .then(res => {
// console.log(res) console.log(res.data.data.user_type)
localStorage.setItem('user_type', '1')
// 请求接口完成注册 请求成功 // 请求接口完成注册 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
this.showWinStatic = !this.showWinStatic this.showWinStatic = !this.showWinStatic
@@ -227,7 +236,9 @@ export default {
// 用户信息存本地 // 用户信息存本地
sessionStorage.setItem('username', res.data.data.username) sessionStorage.setItem('username', res.data.data.username)
sessionStorage.setItem('pic', res.data.data.pic) sessionStorage.setItem('pic', res.data.data.pic)
sessionStorage.setItem('is_status', res.data.data.is_status)
sessionStorage.setItem('userPwd', this.userpwd) sessionStorage.setItem('userPwd', this.userpwd)
// localStorage.setItem('user_type', res.data.data.user_type)
sessionStorage.setItem( sessionStorage.setItem(
'token', 'token',
'Bearer ' + res.data.data.token 'Bearer ' + res.data.data.token
@@ -331,6 +342,7 @@ export default {
// alert(res.data.message) // alert(res.data.message)
// 请求接口完成注册 请求成功 // 请求接口完成注册 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
localStorage.setItem('user_type', '3')
console.log(this.$route.path, 'this.$router.path') console.log(this.$route.path, 'this.$router.path')
if (this.$route.path !== '/') { if (this.$route.path !== '/') {
this.$router.push({ this.$router.push({
@@ -368,42 +380,60 @@ export default {
mounted () { mounted () {
window.addEventListener('keydown', this.keyDown) window.addEventListener('keydown', this.keyDown)
// IP端 // IP端
let type =localStorage.getItem('user_type');
this.$axios({ this.$axios({
method: 'GET', method: 'POST',
url: 'site/check', url: 'member/index/contrast',
params: {} data: {
}).then(res => { is_status: sessionStorage.getItem('is_status'),
// console.log(res, 'IP段') username: sessionStorage.getItem('username'),
if (res.data.code === 200) {
this.$store.state.normalLogin = false
// 用户信息存本地
sessionStorage.setItem('username', res.data.data.username)
sessionStorage.setItem('pic', res.data.data.pic)
sessionStorage.setItem('userPwd', '123456')
sessionStorage.setItem('token', 'Bearer ' + res.data.data.token)
sessionStorage.setItem('tokenB', res.data.data.token)
window.setTimeout(() => {
sessionStorage.clear()
location.reload()
}, 7200000)
// 登录状态
sessionStorage.setItem('userLogin', false)
this.$auth = true
this.$store.state.ipLogin = true
} else {
if (this.$store.state.ipLogin) {
sessionStorage.clear()
this.$store.state.ipLogin = false
} }
} })
this.userLogin = sessionStorage.getItem('userLogin') .then(res => {
this.userName = sessionStorage.getItem('username') console.log(res)
this.userPic = sessionStorage.getItem('pic')
this.$store.state.normalLogin = this.userLogin
// 请求接口完成 请求成功
}).catch((fail) => {
console.log(fail)
}) })
console.log(type)
if(type != 3){
console.log(123)
this.$axios({
method: 'GET',
url: 'site/check',
params: {}
}).then(res => {
// console.log(res, 'IP段')
if (res.data.code === 200) {
this.$store.state.normalLogin = false
// 用户信息存本地
sessionStorage.setItem('username', res.data.data.username)
sessionStorage.setItem('pic', res.data.data.pic)
sessionStorage.setItem('userPwd', '123456')
sessionStorage.setItem('token', 'Bearer ' + res.data.data.token)
sessionStorage.setItem('tokenB', res.data.data.token)
window.setTimeout(() => {
sessionStorage.clear()
location.reload()
}, 7200000)
// 登录状态
sessionStorage.setItem('userLogin', false)
this.$auth = true
this.$store.state.ipLogin = true
} else {
if (this.$store.state.ipLogin) {
sessionStorage.clear()
this.$store.state.ipLogin = false
}
}
this.userLogin = sessionStorage.getItem('userLogin')
this.userName = sessionStorage.getItem('username')
this.userPic = sessionStorage.getItem('pic')
this.$store.state.normalLogin = this.userLogin
// 请求接口完成 请求成功
}).catch((fail) => {
console.log(fail)
})
}else{
console.log("1")
}
let that = this let that = this
// 监听对象的变化 // 监听对象的变化
/* eslint-disable */ /* eslint-disable */
@@ -418,6 +448,12 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .el-input__inner{
border: none;
height: 3.25rem;
line-height: 3.25rem;
font-size: 20px;
}
// 登陆窗口 // 登陆窗口
.loginSty { .loginSty {
position: fixed; position: fixed;

View File

@@ -8,7 +8,11 @@
<div class="tjHold"> <div class="tjHold">
统计热词 统计热词
<div> <div>
<div v-for="(item,index) in hotFont" :key="index" :title="item" @click="blurUpset(item)">{{comHotCi(item)}}</div> <div v-for="(item,index) in hotFont" :key="index" :title="item">
<span @click="blurUpset(item)"> {{comHotCi(item)}}</span>
<!-- <span class="el-icon-close delhot" @click="del(index)"></span> -->
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -27,6 +31,11 @@ export default {
} }
}, },
methods: { methods: {
del(e){
// console.log(e,1998)
this.hotFont.splice(e,1)
// console.log(this.hotFont)
},
blurUpset (textCont) { blurUpset (textCont) {
/*eslint-disable*/ /*eslint-disable*/
console.log(textCont, '3523') console.log(textCont, '3523')
@@ -92,6 +101,14 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.delhot{
font-size: 1rem;
position: relative;
top: -1rem;
}
.delhot:hover{
color:red;
}
.searchAll { .searchAll {
width: 100%; width: 100%;
display: -webkit-flex; display: -webkit-flex;

View File

@@ -15,6 +15,9 @@ import VueAwesomeSwiper from 'vue-awesome-swiper'
// require styles // require styles
import 'swiper/dist/css/swiper.css' import 'swiper/dist/css/swiper.css'
// import Astrict from './util/a.js'
// 全局指定配置 // 全局指定配置
// 自定义指令实现back-top; // 自定义指令实现back-top;
Vue.directive('scroll-show', { Vue.directive('scroll-show', {
@@ -95,6 +98,7 @@ axios.interceptors.response.use(data => {
// 将图形验证码写入 // 将图形验证码写入
Vue.prototype.$identify = identify.default Vue.prototype.$identify = identify.default
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
// Vue.use(Astrict)
// 引入设置dom元素高度的插件 // 引入设置dom元素高度的插件
Vue.prototype.$detector = require('element-resize-detector') Vue.prototype.$detector = require('element-resize-detector')
// vue人员权限 // vue人员权限

BIN
src/util.zip Normal file

Binary file not shown.

89
src/util/a.js Normal file
View File

@@ -0,0 +1,89 @@
import axios from 'axios'
var lastTime = new Date().getTime();
var currentTime = new Date().getTime();
var timeOut = 30*60*1000; //设置超时时间: 30分
window.onload = function () {
window.document.onmousedown = function () {
localStorage.setItem("lastTime",new Date().getTime());
}
};
function checkTimeout() {
currentTime = new Date().getTime(); //更新当前时间
lastTime = localStorage.getItem("lastTime");
// console.log(currentTime - lastTime);
// console.log(timeOut);
if (currentTime - lastTime > timeOut) { //判断是否超时
console.log("超时");
axios({
method: 'GET',
url: 'member/index/logout',
params: {
'access-token': sessionStorage.getItem('tokenB')
}
})
.then(res => {
console.log(res)
this.$alert(res.data.message, '长时间未操作,自动退出', {
confirmButtonText: '确定'
})
// alert(res.data.message)
// 请求接口完成注册 请求成功
if (res.data.code === 200) {
localStorage.setItem('user_type', '3')
console.log(this.$route.path, 'this.$router.path')
if (this.$route.path !== '/') {
this.$router.push({
path: '/'
})
}
sessionStorage.clear()
this.$router.go(0)
}
})
.catch(fail => {
console.log(fail)
})
// var url = window.location.href;
// var newUrl=url.match(/(\S*)#/)[1];
// window.open(newUrl + '#/login','_self');
}
}
/* 定时器 间隔30秒检测是否长时间未操作页面 */
window.setInterval(checkTimeout, 300000);
// // 引入路由和storage工具函数
// // import storage from '../util/s.js'
// // import router from "@/common/router"
// let lastTime = new Date().getTime()
// let currentTime = new Date().getTime()
// let timeOut = 3000 //设置超时时间: 30分钟
// window.onload = function () {
// window.document.onmousedown = function () {
// stroage.setItem("lastTime", new Date().getTime())
// }
// };
// function checkTimeout() {
// currentTime = new Date().getTime() //更新当前时间
// lastTime = stroage.getItem("lastTime");
// if (currentTime - lastTime > timeOut) { //判断是否超时
// console.log('123456789')
// // 清除storage的数据(登陆信息和token)
// // storage.clear()
// // 跳到登陆页
// // if(router.currentRouter.name == 'login') return // 当前已经是登陆页时不做跳转
// // router.push({ name: 'login' })
// }
// }
// export default function () {
// /* 定时器 间隔30秒检测是否长时间未操作页面 */
// window.setInterval(checkTimeout, 1000);
// }

19
src/util/s.js Normal file
View File

@@ -0,0 +1,19 @@
export default {
setItem(key, value) {
value = JSON.stringify(value);
window.localStorage.setItem(key, value)
},
getItem(key, defaultValue) {
let value = window.localStorage.getItem(key)
try {
value = JSON.parse(value);
} catch {}
return value || defaultValue
},
removeItem(key) {
window.localStorage.removeItem(key)
},
clear() {
window.localStorage.clear()
},
}

File diff suppressed because it is too large Load Diff

View File

@@ -417,7 +417,7 @@ export default {
limit: 8 limit: 8
} }
}).then(res => { }).then(res => {
console.log(res, '快速查询') //console.log(res, '快速查询')
// 请求接口完成 请求成功 // 请求接口完成 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
let brrtLeft = [] let brrtLeft = []
@@ -507,7 +507,7 @@ export default {
params: { params: {
} }
}).then(res => { }).then(res => {
console.log(res, '数据更新') // console.log(res, '数据更新')
// 请求接口完成 请求成功 // 请求接口完成 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
let arrts = [] let arrts = []

View File

@@ -62,7 +62,7 @@
<div v-for="(item,index) in collect" :key="index"> <div v-for="(item,index) in collect" :key="index">
<div :title="item.name"> <div :title="item.name">
<span v-if="!item.staticInput">{{item.name}}</span> <span v-if="!item.staticInput">{{item.name}}</span>
<input <!-- <input
type="text" type="text"
:placeholder="item.name" :placeholder="item.name"
v-model="collectName" v-model="collectName"
@@ -70,7 +70,15 @@
v-focus="true" v-focus="true"
@blur="blurUpset(item.id,item.name)" @blur="blurUpset(item.id,item.name)"
@keyup.enter="blurUpset(item.id,item.name)" @keyup.enter="blurUpset(item.id,item.name)"
/> /> -->
<el-input
:placeholder="item.name"
v-model="collectName"
v-if="item.staticInput"
v-focus="true"
@blur="blurUpset(item.id,item.name)"
@keyup.enter="blurUpset(item.id,item.name)"
></el-input>
</div> </div>
<div :title="item.database" @click="jumpSearch(item)">{{item.database}}</div> <div :title="item.database" @click="jumpSearch(item)">{{item.database}}</div>
<div>{{item.birthTime}}</div> <div>{{item.birthTime}}</div>

View File

@@ -8,34 +8,34 @@
<div class="register_main"> <div class="register_main">
<div class="title">个人用户注册</div> <div class="title">个人用户注册</div>
<div> <div>
<div>用户名称</div> <div><span style="color:red">*</span>用户名称</div>
<input type="text" placeholder="请输入您的真实姓名" v-model="registerData.username" /> <input type="text" placeholder="请输入您的用户名,必须为英文或数字组合" onKeyUp="value=value.replace(/[\W]/g,'')" v-model="registerData.username" />
</div> </div>
<div> <div>
<div>电话号码</div> <div><span style="color:red">*</span>电话号码</div>
<input type="text" placeholder="请输入手机号或座机号" v-model="registerData.userIphone" /> <input type="text" placeholder="请输入手机号或座机号" v-model="registerData.userIphone" />
</div> </div>
<div> <div>
<div>邮箱地址</div> <div><span style="color:red">*</span>邮箱地址</div>
<input type="text" placeholder="请输入邮箱" v-model="registerData.userMail" /> <input type="text" placeholder="请输入邮箱" v-model="registerData.userMail" />
</div> </div>
<div> <div>
<div>设置密码</div> <div><span style="color:red">*</span>设置密码</div>
<input type="password" placeholder="请输入密码" v-model="registerData.password" /> <input type="password" placeholder="请输入密码" v-model="registerData.password" />
</div> </div>
<div> <div>
<div>确认密码</div> <div><span style="color:red">*</span>确认密码</div>
<input type="password" placeholder="请重新输入密码" v-model="registerData.passwordQR" /> <input type="password" placeholder="请重新输入密码" v-model="registerData.passwordQR" />
</div> </div>
<div> <div>
<div>机构名称</div> <div><span style="color:red">*</span>机构名称</div>
<input type="text" placeholder="请输入机构名称" v-model="registerData.organizationName" /> <input type="text" placeholder="请输入机构名称" v-model="registerData.organizationName" />
</div> </div>
<div> <div style="margin-left:15px">
<div>机构地址</div> <div>机构地址</div>
<textarea placeholder="请输入机构地址" v-model="registerData.organizationSite"></textarea> <input placeholder="请输入机构地址" type="text" v-model="registerData.organizationSite" />
</div> </div>
<div> <div style="margin-left:15px">
<div>所属部门</div> <div>所属部门</div>
<input type="text" placeholder="请输入所属部门" v-model="registerData.department" /> <input type="text" placeholder="请输入所属部门" v-model="registerData.department" />
</div> </div>
@@ -91,12 +91,14 @@ export default {
this.$alert('电话号码不能为空!', '温馨提示', { this.$alert('电话号码不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else if (this.registerData.userMail === '') { }
else if (this.registerData.userMail === '') {
// alert('邮箱地址不能为空!') // alert('邮箱地址不能为空!')
this.$alert('邮箱地址不能为空!', '温馨提示', { this.$alert('邮箱地址不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else if (this.registerData.password === '') { }
else if (this.registerData.password === '') {
// alert('设置密码不能为空!') // alert('设置密码不能为空!')
this.$alert('设置密码不能为空!', '温馨提示', { this.$alert('设置密码不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
@@ -111,17 +113,19 @@ export default {
this.$alert('机构名称不能为空!', '温馨提示', { this.$alert('机构名称不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else if (this.registerData.organizationSite === '') { }
// alert('机构地址不能为空!') // else if (this.registerData.organizationSite === '') {
this.$alert('机构地址不能为空!', '温馨提示', { // // alert('机构地址不能为空!')
confirmButtonText: '确定' // this.$alert('机构地址不能为空!', '温馨提示', {
}) // confirmButtonText: '确定'
} else if (this.registerData.department === '') { // })
// alert('所属部门不能为空!') // } else if (this.registerData.department === '') {
this.$alert('所属部门不能为空!', '温馨提示', { // // alert('所属部门不能为空!')
confirmButtonText: '确定' // this.$alert('所属部门不能为空!', '温馨提示', {
}) // confirmButtonText: '确定'
} else if (!(/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(this.registerData.userIphone))) { // 验证手机号 // })
// }
else if (!(/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(this.registerData.userIphone))) { // 验证手机号
// alert('您输入的手机号码有误!') // alert('您输入的手机号码有误!')
this.$alert('您输入的手机号码有误!', '温馨提示', { this.$alert('您输入的手机号码有误!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
@@ -176,7 +180,7 @@ export default {
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
& > .register_main { & > .register_main {
margin-bottom: 1.5rem; margin-bottom: 1rem;
width: 84.25rem; width: 84.25rem;
background-color: #fff; background-color: #fff;
// border: 1px solid red; // border: 1px solid red;
@@ -193,7 +197,7 @@ export default {
color: #000000; color: #000000;
} }
& > div:nth-child(n + 2) { & > div:nth-child(n + 2) {
height: 5.625rem; height: 4.5rem;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
@@ -217,7 +221,7 @@ export default {
} }
& > textarea { & > textarea {
width: 23.375rem; width: 23.375rem;
height: 5.5rem; height: 4rem;
font-size: 1rem; font-size: 1rem;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;

View File

@@ -13,18 +13,7 @@
<span @click="$router.go(0)">联系我们</span> <span @click="$router.go(0)">联系我们</span>
</div> </div>
</div> </div>
<div class="center"> <div class="bottom">
<div class="title">留言板</div>
<div class="center_input">
<input type="text" placeholder="姓名*" v-model="leave.name" />
<input type="text" placeholder="邮箱*" v-model="leave.mail" />
<input type="text" placeholder="电话*" v-model="leave.iphone" />
</div>
<input type="text" placeholder="标题*" v-model="leave.title" />
<textarea v-model="leave.cont" placeholder="留言内容*"></textarea>
<div class="sub" @click="upoloadMessage">提交</div>
</div>
<div class="bottom">
<div class="contactWay">联系方式</div> <div class="contactWay">联系方式</div>
<div class="contactWay_cont"> <div class="contactWay_cont">
<div v-for="(item,index) in relationData" :key="index"> <div v-for="(item,index) in relationData" :key="index">
@@ -47,6 +36,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="center">
<div class="title">留言板</div>
<div class="center_input">
<input type="text" placeholder="姓名*" v-model="leave.name" />
<input type="text" placeholder="邮箱*" v-model="leave.mail" />
<input type="text" placeholder="请输入手机号或座机号*" v-model="leave.iphone" />
</div>
<input type="text" placeholder="标题" v-model="leave.title" />
<textarea v-model="leave.cont" placeholder="留言内容*"></textarea>
<div class="sub" @click="upoloadMessage">提交</div>
</div>
</div> </div>
<!-- 页脚信息 --> <!-- 页脚信息 -->
@@ -158,12 +159,14 @@ export default {
this.$alert('电话号码不能为空!', '温馨提示', { this.$alert('电话号码不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else if (this.leave.title === '') { }
// alert('标题不能为空!') // else if (this.leave.title === '') {
this.$alert('标题不能为空!', '温馨提示', { // // alert('标题不能为空!')
confirmButtonText: '确定' // this.$alert('标题不能为空!', '温馨提示', {
}) // confirmButtonText: '确定'
} else if (this.leave.cont === '') { // })
// }
else if (this.leave.cont === '') {
// alert('留言内容不能为空!') // alert('留言内容不能为空!')
this.$alert('留言内容不能为空!', '温馨提示', { this.$alert('留言内容不能为空!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
@@ -173,13 +176,10 @@ export default {
this.$alert('您输入的邮箱地址不正确,请重新填写!', '温馨提示', { this.$alert('您输入的邮箱地址不正确,请重新填写!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else if (!(/^1[3456789]\d{9}$/.test(this.leave.iphone))) { } else if ((/^1(3|4|7|5|8)([0-9]{9})/.test(this.leave.iphone))||(/\d{3}-\d{8}|\d{4}-\d{7,8}/.test(this.leave.iphone))){
// alert('您输入的电话号码不正确,请重新填写!')
this.$alert('您输入的电话号码不正确,请重新填写!', '温馨提示', {
confirmButtonText: '确定' this.$axios({
})
} else {
this.$axios({
method: 'POST', method: 'POST',
url: 'aboutus/about-us/message', url: 'aboutus/about-us/message',
data: { data: {
@@ -206,6 +206,13 @@ export default {
}).catch((fail) => { }).catch((fail) => {
console.log(fail) console.log(fail)
}) })
} else {
// alert('您输入的电话号码不正确,请重新填写!')
console.log(!(/^1(3|4|7|5|8)([0-9]{9})/.test(this.leave.iphone)))
console.log(!(/^0[0-9]{2,3}-[0-9]{8}/.test(this.leave.iphone)))
this.$alert('您输入的电话号码不正确,请重新填写!', '温馨提示', {
confirmButtonText: '确定'
})
} }
} }
}, },

View File

@@ -14,13 +14,21 @@
<div class="left">相关搜索约为 {{pageConfiguration.countSize}} </div> <div class="left">相关搜索约为 {{pageConfiguration.countSize}} </div>
<div class="right"> <div class="right">
<span>筛选栏目</span> <span>筛选栏目</span>
<cityPicker <el-select v-model="lanmu" @change="change1">
<el-option
v-for="item in shaxuanlist"
:key="item.id"
:label="!isNaN(item.type)?(item.type==1?item.name+'(地区)':item.name+'(非地区)'):item.name"
:value="item.id"
></el-option>
</el-select>
<!-- <cityPicker
:level="jishu" :level="jishu"
:selectpattern="selectpattern" :selectpattern="selectpattern"
:city-data="cityData" :city-data="cityData"
:default-city="cityDefaultName" :default-city="cityDefaultName"
@choice-caller="choiceCaller" @choice-caller="choiceCaller"
></cityPicker> ></cityPicker> -->
<span @click="getSearchData(pageConfiguration.nowPage)">刷新</span> <span @click="getSearchData(pageConfiguration.nowPage)">刷新</span>
</div> </div>
</div> </div>
@@ -120,7 +128,7 @@ export default {
// 分页配置 // 分页配置
pageConfiguration: { pageConfiguration: {
// 每页显示条数 // 每页显示条数
oneSize: 2, oneSize: 10,
// 数据总条数 // 数据总条数
countSize: null, countSize: null,
// 总页数 // 总页数
@@ -131,10 +139,58 @@ export default {
// 筛选栏目type // 筛选栏目type
selectLMType: '', selectLMType: '',
// 筛选栏目id // 筛选栏目id
selectLMId: '' selectLMId: '',
shaxuanlist:[{name:"全部",type:'a',id:0}],
lanmu:0
} }
}, },
methods: { methods: {
change1(e){
console.log(e)
this.$axios({
method: "GET",
url: "search/search/list",
params: {
key: this.$route.query.keyVal,
limit: 10,
page: 1,
type: this.selectLMType,
id: e
}
})
.then(res => {
console.log(res, "全局搜索数据");
// 请求接口完成 请求成功
if (res.data.code === 200) {
let arrts = [];
res.data.data.list.forEach((item, index) => {
// console.log(item)
let srtAs = {
id: item.id,
name: item.name,
className: item.cname,
lmss: item.classify,
classify_id: item.classify_id,
f: item.f,
type: item.type
};
arrts.push(srtAs);
});
this.searchData = arrts;
this.pageConfiguration.countSize = parseInt(res.data.data.total);
console.log(this.pageConfiguration);
console.log(this.searchData, "searchdata");
} else {
// alert(res.data.message)
this.$alert(res.data.message, "温馨提示", {
confirmButtonText: "确定"
});
}
})
.catch(fail => {
console.log(fail);
});
},
// 自动运行 // 自动运行
dfyu () { dfyu () {
const products = [ const products = [
@@ -197,7 +253,7 @@ export default {
url: 'search/search/list', url: 'search/search/list',
params: { params: {
key: this.$route.query.keyVal, key: this.$route.query.keyVal,
limit: 2, limit: 10,
page: page, page: page,
type: this.selectLMType, type: this.selectLMType,
id: this.selectLMId id: this.selectLMId
@@ -241,6 +297,9 @@ export default {
} }
}).then(res => { }).then(res => {
console.log(res, '筛选栏目') console.log(res, '筛选栏目')
for(let i in res.data.data.list){
this.shaxuanlist.push(res.data.data.list[i])
}
// 请求接口完成 请求成功 // 请求接口完成 请求成功
if (res.data.code === 200) { if (res.data.code === 200) {
let arrts = [] let arrts = []

View File

@@ -13,6 +13,8 @@
<span>当前位置</span> <span>当前位置</span>
<span @click="$router.push('/')">首页</span> <span @click="$router.push('/')">首页</span>
> >
<span @click="$router.push('/register')">用户注册</span>
>
<span @click="$router.push('/userAgreement')">用户协议</span> <span @click="$router.push('/userAgreement')">用户协议</span>
</div> </div>
</div> </div>

View File

@@ -63,7 +63,9 @@ module.exports = {
}, },
// 配置跨域 // 配置跨域
'/v1/': { '/v1/': {
target: 'http://data.it-blog.wang/api/v1/', target: 'http://www.zhishidata.com/api/v1/',
// target: 'http://abc.zhangjiwei.top/api/v1/',
// target: 'http://data.it-blog.wang/api/v1/',
ws: false, // 允许重写 ws: false, // 允许重写
changeOrigin: true, // 允许跨域 changeOrigin: true, // 允许跨域
pathRewrite: { pathRewrite: {