diff --git a/.env.prostaging b/.env.prostaging index 99c98d1..b6fdf0d 100644 --- a/.env.prostaging +++ b/.env.prostaging @@ -3,10 +3,6 @@ NODE_ENV = production # just a flag ENV = 'prostaging' -# base api -#VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/ -#VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file -#VUE_APP_PREVIEW=//view.langye.net:8012/onlinePreview # base api VUE_APP_BASE_API='' VUE_APP_UPLOAD_API=/api/admin/upload-file diff --git a/package.json b/package.json index 68420eb..5722ed5 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "author": "Pan ", "scripts": { "dev": "vue-cli-service serve", + "dev:prod": "vue-cli-service serve --mode production", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "build:prostaging": "vue-cli-service build --mode prostaging", diff --git a/src/assets/arrow.png b/src/assets/arrow.png new file mode 100644 index 0000000..4ede9d6 Binary files /dev/null and b/src/assets/arrow.png differ diff --git a/src/store/modules/bigdata.js b/src/store/modules/bigdata.js index 969ac90..4fcfe1b 100644 --- a/src/store/modules/bigdata.js +++ b/src/store/modules/bigdata.js @@ -1,4 +1,5 @@ import { index } from "@/api/system/baseForm"; +import { departmentStatistics } from "@/api/statics"; import * as $moment from "moment"; const state = { assets: [[],[]], @@ -7,6 +8,7 @@ const state = { safety: [], safetyPlan: [], adventSafetyPlan: [], + departmentStatics: {}, type: 1, is_auth: 1, } @@ -36,6 +38,9 @@ const mutations = { }, SET_SAFETY: (state, safety) => { state.safety = safety + }, + SET_DEPARTMENT_STATICS: (state, val) => { + state.departmentStatics = val } } @@ -235,7 +240,17 @@ const actions = { reject(err) }) }) - } + }, + async getDepartmentStatics({ commit }) { + return new Promise((resolve, reject) => { + departmentStatistics().then(res => { + commit("SET_DEPARTMENT_STATICS", res.departments) + resolve(res) + }).catch(err => { + reject(err) + }) + }) + } } export default { diff --git a/src/views/assets/detail.vue b/src/views/assets/detail.vue index 733631e..5af612a 100644 --- a/src/views/assets/detail.vue +++ b/src/views/assets/detail.vue @@ -1193,7 +1193,7 @@ export default { if ((this.detail.tudiquanshuren !== this.detail.quanliren) || (this.detail.dengjimianji !== this.detail.shijimianji)) { let text = "" - text += this.detail.tudiquanshuren !== this.detail.quanliren + text += (this.detail.hasOwnProperty('land_id') ? (this.detail.quanshuren !== this.detail.quanliren) : (this.detail.tudiquanshuren !== this.detail.quanliren)) ? " 权利人名称不符 " : "" text += this.detail.dengjimianji !== this.detail.shijimianji diff --git a/src/views/dataShow/index.vue b/src/views/dataShow/index.vue index ce5508c..dd5606a 100644 --- a/src/views/dataShow/index.vue +++ b/src/views/dataShow/index.vue @@ -68,7 +68,8 @@ export default { getAdventLeases: "getAdventLeases", getSafety: "getSafety", getSafetyPlan: "getSafetyPlan", - getAdventSafetyPlan: "getAdventSafetyPlan" + getAdventSafetyPlan: "getAdventSafetyPlan", + getDepartmentStatics: "getDepartmentStatics" }) }, computed: { @@ -88,6 +89,7 @@ export default { this.getSafety() this.getSafetyPlan() this.getAdventSafetyPlan() + this.getDepartmentStatics() } } diff --git a/src/views/dataShow/leftBottom.vue b/src/views/dataShow/leftBottom.vue index f6636f9..dc6a945 100644 --- a/src/views/dataShow/leftBottom.vue +++ b/src/views/dataShow/leftBottom.vue @@ -10,7 +10,7 @@ @@ -23,15 +43,19 @@ import * as echarts from 'echarts' import 'echarts-gl' import WUXI from '@/assets/wuxi.json' import tooltip from './tooltip.vue' +import SvgIcon from "@/components/SvgIcon" import { show as customFormFieldShow } from '@/api/system/customFormField' export default { components: { - tooltip + tooltip, + SvgIcon }, data() { return { + infoHouse: [], areaName: "", + wxAreas: ["宜兴市", "惠山区", "新吴区", "梁溪区", "江阴市", "滨湖区", "锡山区"], areas: new Map([ [1,"宜兴市"], [2,"惠山区"], @@ -73,10 +97,25 @@ export default { mapTooltipPos: { x: 0, y: 0, - } + position: 'fixed' + }, + + config: { + data: [] + }, + departmentStaticsWatch: null, + departmentStaticsId: 0, } }, methods: { + boardClick ({ rowIndex }) { + let data = this.labelData.filter(i => !i.isWx)[rowIndex] + this.mapTooltipPos.position = 'absolute' + this.areaName = data?.name + this.params = data?.originalData + this.infoHouse = data?.originalHouse + this.$refs.tooltip.show() + }, async getWxAreas () { try { const res = await customFormFieldShow({ id: 120 }) @@ -106,8 +145,10 @@ export default { this.chart.on("click", params => { this.mapTooltipPos.x = params.event.offsetX; this.mapTooltipPos.y = params.event.offsetY; + this.mapTooltipPos.position = 'fixed'; this.areaName = params.name; - this.params = params?.data?.originalData; + this.infoHouse = this.labelData.find(j => j.name === params.name)?.originalHouse + this.params = this.labelData.find(j => j.name === params.name)?.originalData; this.$refs.tooltip.show() }) }, @@ -119,19 +160,20 @@ export default { }, setOption () { this.chart.setOption(this.chartOption); + }, + setConfig () { + this.config = { + headerBGC: '#4fa497', + header: ['区域', '数量'], + data: this.labelData.filter(i => !i.isWx).map(i => [i.name, i.value]), + columnWidth: [200, 180], + align: ['center', 'center'] + } } }, computed: { chartOption () { return { - // tooltip: { - // trigger: 'item', - // formatter: (params) => { - // this.params = params; - // - // return this.mapTooltip; - // }, - // }, series: [{ type: 'map3D', // map、map3D map: 'wuxi', // 注册的地图名称 @@ -224,15 +266,10 @@ export default { tag: item[0], name: item[1], value: 0, - originalData: [] + originalData: [], + originalHouse: [], + isWx: this.wxAreas.indexOf(item[1]) !== -1 })) - // houses.forEach(item => { - // let find = temp.find(v => v.tag === item.area) - // if (find) { - // find.value++; - // find.originalData.push(item) - // } - // }) lands.forEach(item => { let find = temp.find(v => v.tag === item.area) if (find) { @@ -240,6 +277,12 @@ export default { find.originalData.push(item) } }) + houses.forEach(item => { + let find = temp.find(v => v.tag === item.area) + if (find) { + find.originalHouse.push(item) + } + }) return temp.filter(v => v.value > 0); } @@ -247,13 +290,18 @@ export default { watch: { labelData () { this.setOption() - } + this.setConfig() + }, }, created() { this.getWxAreas() }, mounted() { this.initMap(); + this.departmentStaticsWatch = this.$watch(() => this.$store.state.bigdata?.departmentStatics, () => this.departmentStaticsId++) + }, + beforeDestroy() { + this.departmentStaticsWatch() } } @@ -265,10 +313,10 @@ export default { background: linear-gradient(to bottom, #00000022 , #61b9ac66); } .tooltip-table { + width: 606px; + height: 500px; position: fixed; z-index: 99999996; - top: 0; - left: 0; } .switch-btn { position: absolute; @@ -329,4 +377,41 @@ export default { } } } +.department-statics { + position: absolute; + left: 10px; + top: 90px; + max-height: calc(100vh - 110px); + overflow: hidden scroll; + + &__item { + color: #fff; + padding: 12px 18px; + + &--name { + font-size: 17px; + font-weight: 600; + margin-bottom: 6px; + } + &--house, &--land { + text-indent: 6px; + } + .text-icon { + color: #73f3df; + } + } +} +.other-asset { + cursor: pointer; + position: absolute; + bottom: 10px; + right: 10px; + + &__arrow { + width: 110px; + height: 160px; + object-fit: contain; + transform: translateX(-30px) rotate(9deg); + } +} diff --git a/src/views/dataShow/tooltip.vue b/src/views/dataShow/tooltip.vue index 959c718..d0c1b3d 100644 --- a/src/views/dataShow/tooltip.vue +++ b/src/views/dataShow/tooltip.vue @@ -1,7 +1,13 @@ @@ -13,6 +19,10 @@ export default { info: { type: Array, default: () => [] + }, + house: { + type: Array, + default: () => [] } }, data() { @@ -39,7 +49,7 @@ export default { { key: 'department.name', title: '所属公司', - width: 180, + width: 170, align: 'center', render: (h, { row }) => h('div', row.department ? row.department.name : '') }, @@ -90,12 +100,39 @@ export default { if (!(tooltipDom === e.target || tooltipDom.contains(e.target))) { this.hide() } + }, + handleSummary({ columns, data }) { + const sums = {}; + columns.forEach((column, index) => { + const key = column.key; + if (index === 0) { + let landSum = this.info?.reduce((pre, cur) => pre + isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji),0) + sums[key] = { + key, + value: '土地'+landSum+'(m²)' + }; + return; + } else if (index === 1) { + let houseSum = this.house?.reduce((pre, cur) => pre + isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji),0) + sums[key] = { + key, + value: '房产'+houseSum+'(m²)' + }; + return; + } else { + sums[key] = { + key, + value: '' + }; + } + }); + + return sums; } }, computed: { showInfo () { return this.info - //return this.info?.slice(this.index, this.index + 8) || []; } }, watch: { diff --git a/src/views/lease/component/LetImport.vue b/src/views/lease/component/LetImport.vue new file mode 100644 index 0000000..1f9066c --- /dev/null +++ b/src/views/lease/component/LetImport.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/views/statics/DepartmentStatistics.vue b/src/views/statics/DepartmentStatistics.vue index 8e63f40..6a1d728 100644 --- a/src/views/statics/DepartmentStatistics.vue +++ b/src/views/statics/DepartmentStatistics.vue @@ -9,16 +9,23 @@ >
- -
- - + + + + + + + + + + +
@@ -26,21 +33,35 @@ diff --git a/src/views/statics/component/HousePieChart.vue b/src/views/statics/component/HousePieChart.vue new file mode 100644 index 0000000..8b00d2a --- /dev/null +++ b/src/views/statics/component/HousePieChart.vue @@ -0,0 +1,113 @@ + + + diff --git a/src/views/statics/component/LandPieChart.vue b/src/views/statics/component/LandPieChart.vue new file mode 100644 index 0000000..37595a9 --- /dev/null +++ b/src/views/statics/component/LandPieChart.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/views/statics/component/barLineChart.vue b/src/views/statics/component/barLineChart.vue index 82766f0..304176f 100644 --- a/src/views/statics/component/barLineChart.vue +++ b/src/views/statics/component/barLineChart.vue @@ -28,16 +28,18 @@ export default { height: { type: String, default: '200px' + }, + myData: { + type: Array, + default: () => [] } }, data() { return { chart: null, - data: [], } }, mounted() { - this.getData().then(_ => this.initChart()) }, beforeDestroy() { if (!this.chart) { @@ -46,15 +48,36 @@ export default { this.chart.dispose() this.chart = null }, + computed: { + }, + watch: { + myData: { + handler: function(newVal) { + this.initChart() + }, + immediate: true + } + }, methods: { - async getData () { - const res = await departmentStatistics(); - console.log(res) - this.data = res.departments; + handleNum (num, precision=2) { + if (!num) return Number(0).toFixed(precision) + if (typeof num === 'string') { + if (isNaN(Number(num))) { + return Number(0).toFixed(precision) + } else { + return Number(num).toFixed(precision) + } + } else if (typeof num === 'number') { + return num.toFixed(precision) + } else { + return Number(0).toFixed(precision) + } }, initChart() { - this.chart = echarts.init(document.getElementById(this.id)) - this.setOption() + this.$nextTick(() => { + this.chart = echarts.init(document.getElementById(this.id)) + this.setOption() + }) }, setOption () { this.chart.setOption({ @@ -90,11 +113,23 @@ export default { saveAsImage: { show: true } } }, + dataZoom: [ + { + type: 'inside' + }, + { + type: 'slider' + } + ], xAxis: [ { type: 'category', axisTick: { show: false }, - data: this.data.map(i => i.name) + axisLabel: { + interval: 0, + rotate: 37 + }, + data: this.myData.map(i => i.name) } ], yAxis: [ @@ -104,59 +139,26 @@ export default { ], series: [ { - name: '土地', - type: 'bar', - barGap: 0, - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.land_count) - }, - { - name: '土地登记面积', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.land_dengjimianji.toFixed(2)) - }, - { + barWidth: 30, name: '土地实际面积', type: 'bar', emphasis: { focus: 'series' }, - data: this.data.map(i => i.land_shijimianji.toFixed(2)) - }, - { - name: '房产', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.house_count) - }, - { - name: '房产登记面积', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.house_dengjimianji.toFixed(2)) + data: this.myData.map(i => this.handleNum(i.land_shijimianji)) }, { + barWidth: 30, name: '房产实际面积', type: 'bar', emphasis: { focus: 'series' }, - data: this.data.map(i => i.house_shijimianji.toFixed(2)) + data: this.myData.map(i => this.handleNum(i.house_shijimianji)) }, ] }) } }, - watch: { - } } diff --git a/src/views/statics/component/barLineChart1.vue b/src/views/statics/component/barLineChart1.vue index 769a0a2..51e48f0 100644 --- a/src/views/statics/component/barLineChart1.vue +++ b/src/views/statics/component/barLineChart1.vue @@ -28,16 +28,18 @@ export default { height: { type: String, default: '200px' + }, + myData: { + type: Array, + default: () => [] } }, data() { return { chart: null, - data: [], } }, mounted() { - this.getData().then(_ => this.initChart()) }, beforeDestroy() { if (!this.chart) { @@ -46,15 +48,34 @@ export default { this.chart.dispose() this.chart = null }, + watch: { + myData: { + handler: function() { + this.initChart() + }, + immediate: true + } + }, methods: { - async getData () { - const res = await departmentStatistics(); - console.log(res) - this.data = res.departments; + handleNum (num, precision=2) { + if (!num) return Number(0).toFixed(precision) + if (typeof num === 'string') { + if (isNaN(Number(num))) { + return Number(0).toFixed(precision) + } else { + return Number(num).toFixed(precision) + } + } else if (typeof num === 'number') { + return num.toFixed(precision) + } else { + return Number(0).toFixed(precision) + } }, initChart() { - this.chart = echarts.init(document.getElementById(this.id)) - this.setOption() + this.$nextTick(() => { + this.chart = echarts.init(document.getElementById(this.id)) + this.setOption() + }) }, setOption () { this.chart.setOption({ @@ -90,11 +111,23 @@ export default { saveAsImage: { show: true } } }, + dataZoom: [ + { + type: 'inside' + }, + { + type: 'slider' + } + ], xAxis: [ { type: 'category', axisTick: { show: false }, - data: this.data.map(i => i.name) + axisLabel: { + interval: 0, + rotate: 37 + }, + data: this.myData.map(i => i.name) } ], yAxis: [ @@ -104,59 +137,26 @@ export default { ], series: [ { - name: '租赁台账', - type: 'bar', - barGap: 0, - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.lease_count) - }, - { - name: '出租土地', + barWidth: 30, + name: '租赁土地面积', type: 'bar', emphasis: { focus: 'series' }, - data: this.data.map(i => i.leases_land_count) + data: this.myData.map(i => this.handleNum(i.leases_land_dengjimianji)) }, { - name: '出租土地面积', + barWidth: 30, + name: '租赁房产面积', type: 'bar', emphasis: { focus: 'series' }, - data: this.data.map(i => i.leases_land_dengjimianji.toFixed(2)) - }, - { - name: '出租房产', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.leases_house_count) - }, - { - name: '出租房产面积', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.leases_house_dengjimianji.toFixed(2)) - }, - { - name: '房产实际面积', - type: 'bar', - emphasis: { - focus: 'series' - }, - data: this.data.map(i => i.house_shijimianji.toFixed(2)) - }, + data: this.myData.map(i => this.handleNum(i.leases_house_dengjimianji)) + } ] }) } - }, - watch: { } }