fanzhen 1209
This commit is contained in:
28
src/assets/js/createObjectUrl.js
Normal file
28
src/assets/js/createObjectUrl.js
Normal file
@@ -0,0 +1,28 @@
|
||||
(function () {
|
||||
var _createObjectURL = window.URL.createObjectURL
|
||||
Object.defineProperty(window.URL, 'createObjectURL', {
|
||||
set: function (value) {
|
||||
console.trace('set createObjectURL')
|
||||
_createObjectURL = value
|
||||
},
|
||||
get: function () {
|
||||
console.trace('get createObjectURL')
|
||||
return _createObjectURL
|
||||
}
|
||||
})
|
||||
})()
|
||||
// (function () {
|
||||
// var _URL = window.URL
|
||||
// Object.defineProperty(window, 'URL', {
|
||||
// set: function (value) {
|
||||
// console.trace('set URL')
|
||||
// console.log(value)
|
||||
// _URL = value
|
||||
// },
|
||||
// get: function (value) {
|
||||
// console.trace('get URL')
|
||||
// console.log(value)
|
||||
// return _URL
|
||||
// }
|
||||
// })
|
||||
// })()
|
||||
120
src/assets/js/verifyMathematicalExpression.js
Normal file
120
src/assets/js/verifyMathematicalExpression.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/* eslint-disable */
|
||||
const fn = (string, obj) => {
|
||||
console.log(string)
|
||||
console.log(obj)
|
||||
|
||||
// 剔除空白符
|
||||
string = string.replace(/\s/g, '')
|
||||
|
||||
// 错误情况,空字符串
|
||||
if (string === '') {
|
||||
console.log('error:空字符串')
|
||||
return false;
|
||||
}
|
||||
if (/^[\x\÷\+\-\*\/]/.test(string)) {
|
||||
// console.error(& amp; quot; 运算符开头 & amp; quot;);
|
||||
console.log('error:运算符开头')
|
||||
return false
|
||||
}
|
||||
|
||||
// 错误情况,运算符结尾
|
||||
if (/[\x\÷\+\-\*\/]$/.test(string)) {
|
||||
// console.error(& amp; quot; 运算符结尾 & amp; quot;);
|
||||
console.log('error:运算符结尾')
|
||||
return false
|
||||
}
|
||||
|
||||
// 错误情况,(后面是运算符或者)
|
||||
if (/\([\x\÷\+\-\*\/]/.test(string)) {
|
||||
// console.error(& amp; quot; (后面是运算符或者) & amp; quot;);
|
||||
console.log('error:后面是运算符或者')
|
||||
return false
|
||||
}
|
||||
// 错误情况,运算符连续
|
||||
if (/[\x\÷\+\-\*\/]{2,}/.test(string)) {
|
||||
console.log('error:运算符连续')
|
||||
return false
|
||||
}
|
||||
|
||||
// 空括号
|
||||
if (/\(\)/.test(string)) {
|
||||
console.log('error:空括号')
|
||||
return false
|
||||
}
|
||||
|
||||
// 错误情况,括号不配对
|
||||
var stack = []
|
||||
for (var i = 0, item; i < string.length; i++) {
|
||||
item = string.charAt(i)
|
||||
if (item === '(') {
|
||||
stack.push('(')
|
||||
} else if (item === ')') {
|
||||
if (stack.length > 0) {
|
||||
stack.pop()
|
||||
} else {
|
||||
console.log('error:括号不配对')
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stack.length !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 错误情况,(后面是运算符
|
||||
if (/\([\x\÷\+\-\*\/]/.test(string)) {
|
||||
console.log('error:(后面是运算符')
|
||||
return false
|
||||
}
|
||||
|
||||
// 错误情况,)前面是运算符
|
||||
if (/[\x\÷\+\-\*\/]\)/.test(string)) {
|
||||
console.log('error:)前面是运算符')
|
||||
return false
|
||||
}
|
||||
// 错误情况,(前面不是运算符
|
||||
if(/[^\+\-\*\/]\(/.test(string)){
|
||||
console.log('error:(前面不是运算符')
|
||||
return false;
|
||||
}
|
||||
|
||||
// 错误情况,)后面不是运算符
|
||||
if(/\)[^\+\-\*\/]/.test(string)){
|
||||
console.log('error:)后面不是运算符')
|
||||
return false;
|
||||
}
|
||||
|
||||
// 错误情况,变量没有来自“待选公式变量”
|
||||
var tmpStr = string.replace(/[\(\)\x\÷\+\-\*\/]{1,}/g, '`')
|
||||
var array = tmpStr.split(',')
|
||||
for (let i = 0, item; i < array.length; i++) {
|
||||
item = array[i]
|
||||
if (/[A-Z]/i.test(item) && typeof (obj[item]) === 'undefined') {
|
||||
console.log('error:变量没有来自“待选公式变量”')
|
||||
return false
|
||||
}
|
||||
}
|
||||
let stringarr = string.split(',')
|
||||
let objarr = Object.keys(obj)
|
||||
for (let index = 0; index < stringarr.length; index++) {
|
||||
if (objarr.indexOf(stringarr[index]) > -1) {
|
||||
if (stringarr[index + 1] === undefined) {
|
||||
|
||||
} else if (
|
||||
stringarr[index + 1] !== '+' &&
|
||||
stringarr[index + 1] !== '.' &&
|
||||
stringarr[index + 1] !== '-' &&
|
||||
stringarr[index + 1] !== 'x' &&
|
||||
stringarr[index + 1] !== '÷' &&
|
||||
stringarr[index + 1] !== '(' &&
|
||||
stringarr[index + 1] !== ')') {
|
||||
console.log('error:变量没有来自“待选公式变量”')
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
export default fn
|
||||
@@ -436,7 +436,29 @@ export default {
|
||||
if (val) {
|
||||
// 初始化公共数据
|
||||
// console.log(this.objCompBefore, 'this.objCompBefore')
|
||||
|
||||
if (JSON.parse(localStorage.getItem('classFiyData')) && JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.tableExplain
|
||||
this.transBefore.timeArr = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.timeArr.map((item, index) => { return item.toString() })
|
||||
this.transBefore.termsName = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsName
|
||||
this.transBefore.termsExplain = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsExplain
|
||||
this.transBefore.areaName = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.areaName
|
||||
this.transBefore.transBeforeTermsData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
} else {
|
||||
console.log(this.defaultDataRight, '获取左侧选中数据555')
|
||||
console.log(this.$store.state.selectData, 'this.$store.state.selectData')
|
||||
console.log(this.$store.state.selectfilter, 'this.$store.state.selectfilter')
|
||||
this.$nextTick(() => {
|
||||
// this.getDatas()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
@@ -445,6 +467,7 @@ export default {
|
||||
// 监听下拉状态变化
|
||||
stateTells (val) {
|
||||
if (val) {
|
||||
console.log(val, 'jjjjjj')
|
||||
if (JSON.parse(localStorage.getItem('classFiyData')) && JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.tableExplain
|
||||
@@ -455,7 +478,7 @@ export default {
|
||||
this.transBefore.transBeforeTermsData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
@@ -739,6 +762,7 @@ export default {
|
||||
if (this.transBefore) {
|
||||
this.objCompBefore.initAllData()
|
||||
}
|
||||
console.log(this.$store.state.selectData, '执行')
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/detail',
|
||||
@@ -750,34 +774,81 @@ export default {
|
||||
quota: this.downLaSelect.label, // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
// filters: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
data: this.$store.state.selectData // 时间
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '获取数据展示数据')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
// if (res.data.data.areaName.length !== 0) {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = res.data.data.tableExplain
|
||||
this.transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
|
||||
this.transBefore.termsName = res.data.data.termsName
|
||||
this.transBefore.termsExplain = res.data.data.termsExplain
|
||||
this.transBefore.areaName = res.data.data.areaName
|
||||
this.transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
// }
|
||||
if (res.data.data.areaName.length !== 0) {
|
||||
if (this.downLaSelect.area === '' || this.downLaSelect.label === '') {
|
||||
console.log(this.downLaSelect.area, 'this.downLaSelect.area')
|
||||
let brrtf = {}
|
||||
// this.transBefore = {}
|
||||
brrtf.tableExplain = res.data.data.tableExplain
|
||||
brrtf.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
|
||||
brrtf.termsName = res.data.data.termsName
|
||||
brrtf.termsExplain = res.data.data.termsExplain
|
||||
brrtf.areaName = res.data.data.areaName
|
||||
if (this.$route.query.type === 'area') {
|
||||
console.log('走这里')
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
} else {
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData[0]
|
||||
}
|
||||
console.log(brrtf, 'brrtf')
|
||||
this.transBefore = brrtf
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
console.log(this.$store.state.noChangeData, 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
|
||||
} else {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = res.data.data.tableExplain
|
||||
this.transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
|
||||
this.transBefore.termsName = res.data.data.termsName
|
||||
this.transBefore.termsExplain = res.data.data.termsExplain
|
||||
this.transBefore.areaName = res.data.data.areaName
|
||||
this.transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
}
|
||||
} else {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = res.data.data.tableExplain
|
||||
this.transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
|
||||
this.transBefore.termsName = res.data.data.termsName
|
||||
this.transBefore.termsExplain = res.data.data.termsExplain
|
||||
this.transBefore.areaName = res.data.data.areaName
|
||||
this.transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
}
|
||||
} else {
|
||||
this.transBefore = null
|
||||
this.$store.state.transdtr = null
|
||||
// this.$store.state.transdtr = null
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = null
|
||||
this.$store.state.noChangeData = null
|
||||
@@ -793,12 +864,24 @@ export default {
|
||||
return (ind) => {
|
||||
let styStatic = false
|
||||
if (this.transState) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData[0].length)) {
|
||||
styStatic = true
|
||||
if (this.transBefore.transBeforeTermsData[0] !== undefined) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData[0].length)) {
|
||||
styStatic = true
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeAreaData[0].length)) {
|
||||
styStatic = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeTermsData.length)) {
|
||||
styStatic = true
|
||||
if (this.transBefore.transBeforeTermsData[0] !== undefined) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData.length)) {
|
||||
styStatic = true
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeAreaData.length)) {
|
||||
styStatic = true
|
||||
}
|
||||
}
|
||||
}
|
||||
return styStatic
|
||||
@@ -809,12 +892,24 @@ export default {
|
||||
return (ind) => {
|
||||
let styStatic = false
|
||||
if (this.transState) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData.length - 1)) {
|
||||
styStatic = true
|
||||
if (this.transBefore.transBeforeTermsData[0] !== undefined) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData.length - 1)) {
|
||||
styStatic = true
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeAreaData.length - 1)) {
|
||||
styStatic = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeTermsData[0].length - 1)) {
|
||||
styStatic = true
|
||||
if (this.transBefore.transBeforeTermsData[0] !== undefined) {
|
||||
if (ind > (this.transBefore.transBeforeTermsData[0].length - 1)) {
|
||||
styStatic = true
|
||||
}
|
||||
} else {
|
||||
if (ind > (this.transBefore.transBeforeAreaData[0].length - 1)) {
|
||||
styStatic = true
|
||||
}
|
||||
}
|
||||
}
|
||||
return styStatic
|
||||
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.searchSelect(this.$route.query.type)
|
||||
} else {
|
||||
|
||||
this.searchSelect(val.f)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
}
|
||||
// 将值传给父组件
|
||||
this.$emit('comTime', resu[2].name)
|
||||
this.showInputStu = !this.showInputStu
|
||||
// this.showInputStu = !this.showInputStu
|
||||
},
|
||||
changesInputStu () {
|
||||
console.log(12569)
|
||||
@@ -180,8 +180,8 @@ export default {
|
||||
this.isHideProp = false
|
||||
},
|
||||
// 查询下拉筛选条件
|
||||
async searchSelect (type) {
|
||||
await this.$axios({
|
||||
searchSelect (type) {
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/quick',
|
||||
params: {
|
||||
@@ -191,18 +191,16 @@ export default {
|
||||
console.log(res, '下拉筛选条件')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
// console.log(Object.keys(res.data.data.list))
|
||||
// console.log(Object.values(res.data.data.list))
|
||||
this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
|
||||
return { 'id': '110000', 'name': Object.values(res.data.data.list)[index], 'parentId': '100000', 'shortName': '北京', 'cityCode': '', indexID: item }
|
||||
})
|
||||
// 默认选中第一个
|
||||
this.$store.state.selectData = this.cityDataTime[0].indexID
|
||||
console.log(this.$store.state.selectData, 'this.cityDataTime[0].indexID')
|
||||
// 告诉父组件我获取到了
|
||||
this.$emit('stateTell', true)
|
||||
}
|
||||
// console.log(Object.keys(res.data.data.list))
|
||||
// console.log(Object.values(res.data.data.list))
|
||||
this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
|
||||
return { 'id': '110000', 'name': Object.values(res.data.data.list)[index], 'parentId': '100000', 'shortName': '北京', 'cityCode': '', indexID: item }
|
||||
})
|
||||
// 默认选中第一个
|
||||
this.$store.state.selectData = this.cityDataTime[0].indexID
|
||||
console.log(this.$store.state.selectData, 'this.cityDataTime[0].indexID')
|
||||
// 告诉父组件我获取到了
|
||||
this.$emit('stateTell', true)
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
@@ -212,6 +210,7 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.cityDataArea = this.cityDataAreas
|
||||
this.cityDataTime = this.cityDataAreas
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -117,6 +117,7 @@ export default {
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
newCityData () {
|
||||
@@ -159,6 +160,7 @@ export default {
|
||||
this.inlay[index].filterDatas.push(list)
|
||||
}
|
||||
}
|
||||
console.log(this.inlay[0], 'this.inlay')
|
||||
},
|
||||
setCity(city) {
|
||||
/* eslint-disable */
|
||||
@@ -297,7 +299,7 @@ export default {
|
||||
document.addEventListener('click', function (e) {
|
||||
/* eslint-disable */
|
||||
// console.log(that.isHideProp, '12569')
|
||||
if (e.target.className !== 'city-picker' && false) {
|
||||
if (e.target.className !== 'city-picker') {
|
||||
that.modifyNature(that.inlay, 'isHide', true)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div>确定</div>
|
||||
<div @click="trueChange()">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,7 +61,12 @@ export default {
|
||||
return {
|
||||
imgUrl: require('../../../static/nav/deleteImg.png'),
|
||||
rowVal: '指标',
|
||||
colVal: '时间'
|
||||
colVal: '时间',
|
||||
arrValue: {
|
||||
'指标': 'zb',
|
||||
'时间': 'sj',
|
||||
'地区': 'dq'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -71,7 +76,109 @@ export default {
|
||||
} else if (strd === 'col') {
|
||||
this.colVal = stateSD
|
||||
}
|
||||
},
|
||||
// 维度转换默认
|
||||
change3D () {
|
||||
if (this.$store.state.transState) {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '指标'
|
||||
this.colVal = '时间'
|
||||
} else {
|
||||
this.rowVal = '地区'
|
||||
this.colVal = '时间'
|
||||
}
|
||||
} else {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '指标'
|
||||
} else {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '地区'
|
||||
}
|
||||
}
|
||||
},
|
||||
// 确定维度转换
|
||||
trueChange () {
|
||||
this.trueChangeArea()
|
||||
},
|
||||
trueChangeArea () {
|
||||
console.log(this.arrValue[this.colVal], 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
|
||||
console.log(this.arrValue[this.rowVal], 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
|
||||
console.log(this.$store.state.noChangeData)
|
||||
let paramsd = {}
|
||||
if ((this.arrValue[this.colVal] === 'sj' && this.arrValue[this.rowVal] === 'zb') || (this.arrValue[this.colVal] === 'zb' && this.arrValue[this.rowVal] === 'sj')) {
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
area: this.$store.state.noChangeData.areaName[0], // 选中的地区
|
||||
quota: '', // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectDataLeft.f, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
// filters: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
date: '', // 时间
|
||||
row: this.arrValue[this.colVal],
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
} else if ((this.arrValue[this.colVal] === 'sj' && this.arrValue[this.rowVal] === 'dq') || (this.arrValue[this.colVal] === 'dq' && this.arrValue[this.rowVal] === 'sj')) {
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
area: '', // 选中的地区
|
||||
quota: this.$store.state.noChangeData.termsName[0], // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectDataLeft.f, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
// filters: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
date: '', // 时间
|
||||
row: this.arrValue[this.colVal],
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
} else if ((this.arrValue[this.colVal] === 'zb' && this.arrValue[this.rowVal] === 'dq') || (this.arrValue[this.colVal] === 'dq' && this.arrValue[this.rowVal] === 'zb')) {
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
area: '', // 选中的地区
|
||||
quota: '', // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectDataLeft.f, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
// filters: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
date: this.$store.state.noChangeData.timeArr[0], // 时间
|
||||
row: this.arrValue[this.colVal],
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
}
|
||||
this.$axios({
|
||||
method: 'POST',
|
||||
url: 'data/data/wd-trans',
|
||||
data: paramsd
|
||||
}).then(res => {
|
||||
console.log(this.$store.state.transBefore, '维度转换全局数据')
|
||||
console.log(res, '获取数据展示数据')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
// if (res.data.data.areaName.length !== 0) {
|
||||
let transBefore = {}
|
||||
transBefore.tableExplain = res.data.data.tableExplain
|
||||
transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
|
||||
transBefore.termsName = res.data.data.termsName
|
||||
transBefore.termsExplain = res.data.data.termsExplain
|
||||
transBefore.areaName = res.data.data.areaName
|
||||
transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// }
|
||||
} else {
|
||||
this.$store.state.transBefore = null
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail, 2369)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.change3D()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -294,6 +294,7 @@ export default {
|
||||
},
|
||||
// 地图左侧指标名称显示
|
||||
searchDataMap () {
|
||||
console.log(this.$store.state.selectDataLeft.id)
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/quota',
|
||||
@@ -321,6 +322,7 @@ export default {
|
||||
}
|
||||
return brrO
|
||||
})
|
||||
console.log(this.leftDafrt, 'this.leftDafrt')
|
||||
this.getLabelDatart()
|
||||
}
|
||||
}).catch((fail) => {
|
||||
@@ -329,6 +331,7 @@ export default {
|
||||
},
|
||||
// 获取每个指标的数据
|
||||
getLabelDatart () {
|
||||
console.log(this.leftDafrt, 1010110)
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/map-data',
|
||||
|
||||
@@ -51,7 +51,9 @@ export default new Vuex.Store({
|
||||
// 下拉筛选分类
|
||||
selectfilter: null,
|
||||
// 下拉筛选条件
|
||||
selectData: 1010110
|
||||
selectData: null,
|
||||
// 转置状态
|
||||
transState: true
|
||||
|
||||
},
|
||||
mutations: {},
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
<!-- 添加收藏 -->
|
||||
<AddCollect v-if="$store.state.addCollectState"></AddCollect>
|
||||
<!-- 维度转换 -->
|
||||
<Dimension v-if="$store.state.dimensionState"></Dimension>
|
||||
<Dimension v-if="$store.state.dimensionState" @changeValue="changeValue"></Dimension>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -324,7 +324,7 @@ export default {
|
||||
{ text: '高级查询', iconUrl: require('../../../static/data/gjcx.png') },
|
||||
{ text: '数据地图', iconUrl: require('../../../static/data/sjdt.png') },
|
||||
{ text: '添加收藏', iconUrl: require('../../../static/data/tjsc.png') },
|
||||
{ text: '导出至Exc', iconUrl: require('../../../static/data/dcexcel.png') },
|
||||
{ text: '导出至Excel', iconUrl: require('../../../static/data/dcexcel.png') },
|
||||
{
|
||||
text: '数据管理',
|
||||
iconUrl: require('../../../static/data/sjgl.png'),
|
||||
@@ -410,10 +410,25 @@ export default {
|
||||
// 新增指标状态
|
||||
statesDf: 1,
|
||||
// 数据加载状态
|
||||
stateTells: false
|
||||
stateTells: false,
|
||||
// 维度转换时(若不是地区数据只进行转置操作)
|
||||
changeState: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
changeState (val) {
|
||||
if (val) {
|
||||
this.chartsStatusMegger.transState = !this.chartsStatusMegger.transState
|
||||
this.$store.state.transState = this.chartsStatusMegger.transState
|
||||
this.changeState = false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 维度转换非地区转置
|
||||
changeValue (val) {
|
||||
this.changeState = val
|
||||
},
|
||||
// 获取左侧菜单数据
|
||||
getCateData () {
|
||||
this.$axios({
|
||||
@@ -659,6 +674,7 @@ export default {
|
||||
break
|
||||
case '转置':
|
||||
this.chartsStatusMegger.transState = !this.chartsStatusMegger.transState
|
||||
this.$store.state.transState = this.chartsStatusMegger.transState
|
||||
break
|
||||
case '维度转换':
|
||||
this.$store.state.dimensionState = true
|
||||
@@ -878,7 +894,7 @@ export default {
|
||||
console.log(stateStatic, '数据')
|
||||
console.log(this.leftCateData[this.leftCateData.length - 1], '数据length-1')
|
||||
this.$store.state.selectDataLeft = this.leftCateData[this.leftCateData.length - 1]
|
||||
console.log(this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0].children[0], '1')
|
||||
// console.log(this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0].children[0], '1')
|
||||
if (this.leftCateData[this.leftCateData.length - 1].children !== undefined) {
|
||||
if (this.leftCateData[this.leftCateData.length - 1].children[0].children !== undefined) {
|
||||
if (this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children !== undefined) {
|
||||
@@ -925,6 +941,7 @@ export default {
|
||||
prentsState (val) {
|
||||
this.stateTells = val
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
// 计算字符串
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<div
|
||||
v-for="(listLeft,keyLeft) in item.textArrLeft"
|
||||
:key="keyLeft"
|
||||
@click="jumpLianjie(true)"
|
||||
@click="jumpLianjie(true,item.type)"
|
||||
>{{listLeft.name}}</div>
|
||||
</div>
|
||||
<div class="center"></div>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div
|
||||
v-for="(listRight,keyRight) in item.textArrRight"
|
||||
:key="keyRight"
|
||||
@click="jumpLianjie(true)"
|
||||
@click="jumpLianjie(true,item.type)"
|
||||
class="ListpaneRight"
|
||||
>{{listRight.name}}</div>
|
||||
</div>
|
||||
@@ -126,7 +126,7 @@
|
||||
<div class="right2">
|
||||
<div class="title">24小时热文</div>
|
||||
<div class="content">
|
||||
<div v-for="(item,index) in twentyFourtimeData" :key="index">
|
||||
<div v-for="(item,index) in twentyFourtimeData" :key="index" @click="$router.push({path:'/listDetails',query:{id:item.id}})">
|
||||
<img :src="item.url" alt />
|
||||
<div>
|
||||
<div class="top" :title="item.title">{{item.title}}</div>
|
||||
@@ -407,7 +407,7 @@ export default {
|
||||
limit: 8
|
||||
}
|
||||
}).then(res => {
|
||||
// console.log(res, '快速查询')
|
||||
console.log(res, '快速查询')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
let brrtLeft = []
|
||||
@@ -506,7 +506,8 @@ export default {
|
||||
title: item.name,
|
||||
updataTime: item.time,
|
||||
table_name: item.table_name,
|
||||
type: item.type
|
||||
type: item.type,
|
||||
filter: item.filter
|
||||
}
|
||||
arrts.push(objuu)
|
||||
})
|
||||
@@ -545,15 +546,27 @@ export default {
|
||||
},
|
||||
// 跳转至数据
|
||||
jumpLianjie (state, value) {
|
||||
console.log(value, 'this.indexDatalabel[this.selectLabelS]')
|
||||
if (state) {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: this.indexDatalabel[this.selectLabelS]
|
||||
if (value === 1) {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: this.indexDatalabel[this.selectLabelS]
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
} else {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: 'area'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
this.$router.push(
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<div class="right2">
|
||||
<div class="title">24小时热文</div>
|
||||
<div class="content">
|
||||
<div v-for="(item,index) in twentyFourtimeData" :key="index">
|
||||
<div v-for="(item,index) in twentyFourtimeData" :key="index" @click="$router.push({path:'/'}),$router.push({path:'/listDetails',query:{id:item.id}}),$router.go(0)">
|
||||
<img :src="item.url" alt />
|
||||
<div>
|
||||
<div class="top">{{item.title}}</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="left">{{staticSelect}}</div>
|
||||
<div class="right" v-if="staticSelect==='我的收藏'&&collect">
|
||||
<input type="text" placeholder="请输入搜索内容" v-model="searchCollect" />
|
||||
<div>搜索</div>
|
||||
<div @click="getCollectData(1)">搜索</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 基本设置 -->
|
||||
@@ -68,15 +68,15 @@
|
||||
v-model="collectName"
|
||||
v-if="item.staticInput"
|
||||
v-focus="true"
|
||||
@blur="blurUpset"
|
||||
@keyup.enter="blurUpset"
|
||||
@blur="blurUpset(item.id,item.name)"
|
||||
@keyup.enter="blurUpset(item.id,item.name)"
|
||||
/>
|
||||
</div>
|
||||
<div :title="item.database">{{item.database}}</div>
|
||||
<div>{{item.birthTime}}</div>
|
||||
<div class="handle">
|
||||
<div @click="editName(index)">编辑</div>/
|
||||
<div @click="deleteData">删除</div>
|
||||
<div @click="deleteData(item.id)">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,6 +89,7 @@
|
||||
class="pagination"
|
||||
:page-size="pageConfiguration.oneSize"
|
||||
:hide-on-single-page="true"
|
||||
@current-change="currentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<div class="collect_no" v-if="!collect">暂无收藏记录</div>
|
||||
@@ -110,11 +111,11 @@
|
||||
<div class="wcont_content">
|
||||
<div>
|
||||
<img :src="imgurl.userpwds" alt />
|
||||
<input type="text" placeholder="请输入密码" v-model="userpwd" />
|
||||
<input type="password" placeholder="请输入密码" v-model="userpwd" />
|
||||
</div>
|
||||
<div>
|
||||
<img :src="imgurl.userpwds" alt />
|
||||
<input type="text" placeholder="请输入确认密码" v-model="userpwdQR" />
|
||||
<input type="password" placeholder="请输入确认密码" v-model="userpwdQR" />
|
||||
</div>
|
||||
<div @click="closeLoginWind(true)">确认</div>
|
||||
</div>
|
||||
@@ -281,21 +282,88 @@ export default {
|
||||
})
|
||||
},
|
||||
// 文本框失去焦点或者回车enter
|
||||
blurUpset () {
|
||||
console.log('文本框失去焦点')
|
||||
// 调用接口修改数据
|
||||
this.collect.forEach((item, index) => {
|
||||
item.staticInput = false
|
||||
blurUpset (ids, names) {
|
||||
let bStr = this.collectName === '' ? names : this.collectName
|
||||
this.$axios({
|
||||
method: 'POST',
|
||||
url: 'member/index/edit',
|
||||
data: {
|
||||
id: ids,
|
||||
name: bStr
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, 12569)
|
||||
// 请求接口完成 请求成功
|
||||
// alert(res.data.message)
|
||||
if (res.data.code === 200) {
|
||||
alert('修改成功!')
|
||||
console.log('文本框失去焦点')
|
||||
// 调用接口修改数据
|
||||
this.collect.forEach((item, index) => {
|
||||
item.staticInput = false
|
||||
})
|
||||
this.getCollectData()
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 删除收藏数据
|
||||
deleteData () {
|
||||
deleteData (ids) {
|
||||
// 调用接口删除数据
|
||||
this.$axios({
|
||||
method: 'POST',
|
||||
url: 'member/index/del',
|
||||
data: {
|
||||
id: ids
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, 1256000009)
|
||||
// 请求接口完成 请求成功
|
||||
// alert(res.data.message)
|
||||
if (res.data.code === 200) {
|
||||
alert('删除成功!')
|
||||
this.getCollectData()
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 获取收藏数据
|
||||
getCollectData () {
|
||||
getCollectData (pagess) {
|
||||
// 调接口获取数据
|
||||
console.log(this.pageConfiguration.countPage)
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'member/index/favorite',
|
||||
params: {
|
||||
page: pagess,
|
||||
limit: 5,
|
||||
key: this.searchCollect
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, 12569)
|
||||
// 请求接口完成 请求成功
|
||||
// alert(res.data.message)
|
||||
if (res.data.code === 200) {
|
||||
this.pageConfiguration.countSize = res.data.data.total
|
||||
this.collect = res.data.data.list.map((item, index) => {
|
||||
return {
|
||||
name: item.name,
|
||||
database: item.db,
|
||||
birthTime: item.updated_at,
|
||||
staticInput: false,
|
||||
adv: item.adv,
|
||||
id: item.id,
|
||||
classify_id: item.classify_id,
|
||||
type: item.type,
|
||||
uid: item.uid
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 获取个人中心数据
|
||||
getPersonalCenter () {
|
||||
@@ -317,6 +385,11 @@ export default {
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 当前页数发生改变时
|
||||
currentChange (val) {
|
||||
this.getCollectData(val)
|
||||
console.log(val, '1010110')
|
||||
}
|
||||
},
|
||||
// 自定义指令v-*
|
||||
@@ -341,7 +414,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getPersonalCenter()
|
||||
this.getPersonalCenter(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user