From 7f58da042bb18e749bee3c9e762e06bbf04dd1d7 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: Sat, 2 Jul 2022 21:21:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/css/vc.css | 25 ++-
public/index.html | 2 +-
.../property/propertyIndex/propertyIndex.html | 27 +++
.../property/propertyIndex/propertyIndex.js | 161 ++++++++++++++++++
4 files changed, 213 insertions(+), 2 deletions(-)
create mode 100755 public/pages/property/propertyIndex/propertyIndex.html
create mode 100755 public/pages/property/propertyIndex/propertyIndex.js
diff --git a/public/css/vc.css b/public/css/vc.css
index c9a423cac..2b7f94f85 100644
--- a/public/css/vc.css
+++ b/public/css/vc.css
@@ -659,4 +659,27 @@ body,
.vc-main .ibox .ibox-content {
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
-}
\ No newline at end of file
+}
+
+.vc-index .index-1-left{
+ width: 65%;
+ padding:10px;
+
+}
+
+.vc-index .index-1-left .index-1-left-1{
+ background-color: #FFFFFF;
+ border-radius: 10px;
+ height: 300px;
+}
+
+.vc-index .index-1-right{
+ width: 35%;
+ padding:10px;
+}
+
+.vc-index .index-1-right .index-1-right-1{
+ background-color: #FFFFFF;
+ border-radius: 10px;
+ height: 300px;
+}
diff --git a/public/index.html b/public/index.html
index 5269788e4..123f5a15c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -66,7 +66,7 @@
-
+
diff --git a/public/pages/property/propertyIndex/propertyIndex.html b/public/pages/property/propertyIndex/propertyIndex.html
new file mode 100755
index 000000000..d1bb9bc1c
--- /dev/null
+++ b/public/pages/property/propertyIndex/propertyIndex.html
@@ -0,0 +1,27 @@
+
\ No newline at end of file
diff --git a/public/pages/property/propertyIndex/propertyIndex.js b/public/pages/property/propertyIndex/propertyIndex.js
new file mode 100755
index 000000000..64b308f5c
--- /dev/null
+++ b/public/pages/property/propertyIndex/propertyIndex.js
@@ -0,0 +1,161 @@
+(function(vc) {
+ vc.extends({
+ data: {
+ indexContextInfo: {
+ ownerCount: '0',
+ noEnterRoomCount: '0',
+ roomCount: '0',
+ freeRoomCount: '0',
+ parkingSpaceCount: '0',
+ freeParkingSpaceCount: '0',
+ shopCount: '0',
+ freeShopCount: '0'
+ }
+ },
+ _initMethod: function() {
+ vc.component._queryIndexContextData();
+ },
+ _initEvent: function() {
+ vc.on("indexContext", "_queryIndexContextData", function(_param) {
+ vc.component._queryIndexContextData();
+ });
+ },
+ methods: {
+ _queryIndexContextData: function() {
+ if (vc.getCurrentCommunity() == null || vc.getCurrentCommunity() == undefined) {
+ return;
+ }
+ var param = {
+ params: {
+ communityId: vc.getCurrentCommunity().communityId
+ }
+ }
+ //发送get请求
+ vc.http.get('indexContext',
+ 'getData',
+ param,
+ function(json, res) {
+ var indexData = JSON.parse(json);
+ vc.copyObject(indexData, vc.component.indexContextInfo);
+ let _dom = document.getElementById('ownerCount');
+ $that._initCharts2(indexData.ownerCount - indexData.noEnterRoomCount, indexData.noEnterRoomCount, _dom, vc.i18n('业主信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('未入住', 'indexContext'));
+ _dom = document.getElementById('roomCount');
+ $that._initCharts2(indexData.roomCount - indexData.freeRoomCount, indexData.freeRoomCount, _dom, vc.i18n('房屋信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('空闲', 'indexContext'));
+ _dom = document.getElementById('parkingSpaceCount');
+ $that._initEcharts(indexData.parkingSpaceCount - indexData.freeParkingSpaceCount, indexData.freeParkingSpaceCount, _dom, vc.i18n('车位信息', 'indexContext'), vc.i18n('已使用', 'indexContext'), vc.i18n('空闲', 'indexContext'));
+ _dom = document.getElementById('shopCount');
+ $that._initCharts2(indexData.shopCount - indexData.freeShopCount, indexData.freeShopCount, _dom, vc.i18n('商铺信息', 'indexContext'), vc.i18n('已出售', 'indexContext'), vc.i18n('空闲', 'indexContext'));
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _initEcharts: function(userCount, freeCount, dom, _title, _userCountName, _freeCountName) {
+ //let dom = document.getElementById("box2");
+ let myChart = echarts.init(dom);
+ let option = null;
+ option = {
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b}: {c} ({d}%)'
+ },
+ color: ['#66CDAA', '#FFDAB9'],
+ series: [{
+ name: _title,
+ type: 'pie',
+ radius: ['60%', '75%'],
+ avoidLabelOverlap: false,
+ label: {
+ show: true,
+ position: 'top'
+ },
+ emphasis: {
+ label: {
+ show: true,
+ fontSize: '20',
+ fontWeight: 'bold'
+ }
+ },
+ labelLine: {
+ show: true
+ },
+ data: [
+ { value: userCount, name: _userCountName },
+ { value: freeCount, name: _freeCountName }
+ ],
+ }]
+ };
+ if (option && typeof option === "object") {
+ myChart.setOption(option, true);
+ }
+ },
+ _initCharts2: function(userCount, freeCount, dom, _title, _userCountName, _freeCountName) {
+ //var dom = document.getElementById("box1");
+ let myChart = echarts.init(dom);
+ let option = null;
+ option = {
+ textStyle: { //图例文字的样式
+ fontSize: 12
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b} : {c} ({d}%)'
+ },
+ color: ['#66CDAA', '#FFDAB9'],
+ series: [{
+ name: _title,
+ type: 'pie',
+ radius: '75%',
+ center: ['50%', '50%'],
+ data: [
+ { value: userCount, name: _userCountName },
+ { value: freeCount, name: _freeCountName }
+ ],
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }]
+ };
+ if (option && typeof option === "object") {
+ myChart.setOption(option, true);
+ }
+ },
+ _initCharts3: function(userCount, freeCount, dom, _title, _userCountName, _freeCountName) {
+ //var dom = document.getElementById("box1");
+ let myChart = echarts.init(dom);
+ let option = null;
+ option = {
+ title: {
+ text: '',
+ subtext: '',
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b} : {c} ({d}%)'
+ },
+ color: ['#66CDAA', '#FFDAB9'],
+ series: [{
+ name: _title,
+ type: 'pie',
+ radius: ['20%', '75%'],
+ center: ['50%', '50%'],
+ roseType: 'area',
+ data: [
+ { value: userCount, name: _userCountName },
+ { value: freeCount, name: _freeCountName }
+ ]
+ }]
+ };
+ if (option && typeof option === "object") {
+ myChart.setOption(option, true);
+ }
+ }
+ }
+ })
+})(window.vc);
\ No newline at end of file