| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <template>
- <div :class="valueClass == 1 ? 'modelBlock' : 'modelBlock enlarge'">
- <template v-if="permissionFiltering">
- <div class="model-title">
- <div class="model-title-text">房屋租售率</div>
- </div>
- <div class="model-content">
- <zz-echart
- :option="clientOptions"
- class="chart"
- ></zz-echart>
- <div class="totals">
- <span>{{ total }}</span>
- <span class="numbers">房屋总数</span>
- </div>
- </div>
- </template>
- <no-permission
- v-else
- tipsText="房屋租售率"
- ></no-permission>
- </div>
- </template>
- <script>
- import { ringType, ringTypeEnlarge } from './indexOptionChart';
- import permissionComponent from './permissionComponent';
- let defaultTitle = {
- text: `{a|租售率}`,
- left: 'center',
- top: '35%',
- left: '18%',
- subtextStyle: {
- rich: {
- b: {
- fontSize: 20,
- color: '#fff'
- }
- }
- },
- textStyle: {
- color: '#ccc',
- rich: {
- a: {
- fontSize: 12,
- color: '#858892',
- padding: [0, 0, 0, 3]
- }
- }
- }
- };
- let defaultTitleEnlarge = {
- text: `{a|租售率}`,
- left: 'center',
- top: '40%',
- left: '19%',
- subtextStyle: {
- rich: {
- b: {
- fontSize: 20,
- color: '#fff'
- }
- }
- },
- textStyle: {
- color: '#ccc',
- rich: {
- a: {
- fontSize: 14,
- color: '#858892',
- padding: [0, 0, 0, 3]
- }
- }
- }
- };
- export default {
- mixins: [permissionComponent],
- data () {
- return {
- valueClass: '',
- mixins_query: {
- communityId: ''
- },
- defaultModel: {
- permissUrl: '11',
- titleName: '房产管理'
- },
- total: 0,
- defaultTitle: {
- text: `{a|租售率}`,
- left: 'center',
- top: '35%',
- left: '18%',
- subtextStyle: {
- rich: {
- b: {
- fontSize: 20,
- color: '#fff'
- }
- }
- },
- textStyle: {
- color: '#ccc',
- rich: {
- a: {
- fontSize: 12,
- color: '#858892',
- padding: [0, 0, 0, 3]
- }
- }
- }
- },
- clientOptions: ringType(
- [],
- [
- { name: '待租售', value: 0 },
- { name: '已售', value: 0 },
- { name: '已租', value: 0 }
- ],
- { subtext: `{b|0%}`, ...defaultTitle }
- )
- };
- },
- methods: {
- getData () {
- this.$http.get('/sc-community/statisticsaleRate', this.mixins_query).then(({ data, msg, status }) => {
- if (status == 0) {
- if (window.screen.width == 1920 || window.screen.width < 1920) {
- this.clientOptions = ringType([], this.eachartObj(data), {
- subtext: `{b|${parseInt(((data.datas[1] + data.datas[2]) / data.total).toFixed(2) * 100) || 0 * 100}%}`,
- ...defaultTitle
- });
- } else if (window.screen.width == 2560 || window.screen.width > 1920) {
- this.clientOptions = ringTypeEnlarge([], this.eachartObj(data), {
- subtext: `{b|${parseInt(((data.datas[1] + data.datas[2]) / data.total).toFixed(2) * 100) || 0 * 100}%}`,
- ...defaultTitleEnlarge
- });
- }
- }
- });
- },
- eachartObj (data) {
- this.total = data.total;
- let typeName = {
- 0: '待租售',
- 1: '已售',
- 2: '已租'
- };
- let newData = [];
- for (let a in data.datas) {
- newData.push({
- value: data.datas[a],
- name: typeName[a]
- });
- }
- return newData;
- }
- },
- created () {
- // this.mixins_query.date = this.$moment().format('YYYY');
- if (window.screen.width == 1920 || window.screen.width < 1920) {
- this.valueClass = 1;
- this.clientOptions = ringType([],
- [
- { name: '待租售', value: 0 },
- { name: '已售', value: 0 },
- { name: '已租', value: 0 }
- ],
- { subtext: `{b|0%}`, ...defaultTitle })
- } else if (window.screen.width == 2560 || window.screen.width > 1920) {
- this.valueClass = 2;
- this.clientOptions = ringTypeEnlarge([],
- [
- { name: '待租售', value: 0 },
- { name: '已售', value: 0 },
- { name: '已租', value: 0 }
- ],
- { subtext: `{b|0%}`, ...defaultTitleEnlarge });
- }
- this.getData();
- }
- };
- </script>
- <style scoped lang="scss">
- @import './style.scss';
- @import './stylePc.scss';
- </style>
|