123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!--
- * @Author: your name
- * @Date: 2022-10-10 12:24:37
- * @LastEditTime: 2022-10-10 14:30:18
- * @LastEditors: D4THYL3
- * @Description: In User Settings Edit
- * @FilePath: \commandCenter\src\views\industrialInvestment\assembly\enterpriseDistribution.vue
- -->
- <template>
- <div :class="valueClass == 1 ? 'modelBlock' : 'modelBlock enlarge'">
- <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 class="fonst-color">{{ total }}</span>
- <span class="numbers fonst-color">企业总数</span>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { ringType, ringTypeEnlarge } from './indexOptionChart';
- import index from './allcommunit';
- export default {
- mixins: [index],
- data () {
- return {
- mixins_query: {
- communityId: ''
- },
- valueClass: "",
- total: 0,
- clientOptions: ringType(
- [],
- [
- { value: 0, name: '餐饮业' },
- { value: 0, name: '互联网' },
- { value: 0, name: '金融业' },
- { value: 0, name: '服务业' },
- ],
- {},
- { type: '', total: 0 }
- )
- };
- },
- methods: {
- getData () {
- this.$http.get('/sc-community/statisticEnterpriseType', this.mixins_query).then(({ data, msg, status }) => {
- if (status == 0) {
- // this.clientOptions = ringType([], this.eachartObj(data), {}, { type: '', total: data.total });
- if (window.screen.width == 1920 || window.screen.width < 1920) {
- this.clientOptions = ringType([], this.eachartObj(data), {}, { type: '', total: data.total });
- } else if (window.screen.width == 2560 || window.screen.width > 1920) {
- this.clientOptions = ringTypeEnlarge([], this.eachartObj(data), {}, { type: '', total: data.total });
- }
- }
- });
- },
- eachartObj (data) {
- this.total = data.total;
- let typeName = {
- 1: '互联网',
- 2: '其他',
- 3: '政府/事业单位',
- 4: '服务业',
- 5: '餐饮业'
- };
- let newData = [];
- for (let a in data.datas) {
- newData.push({
- value: data.datas[a],
- name: a
- });
- }
- return newData;
- }
- },
- created () {
- if (window.screen.width == 1920 || window.screen.width < 1920) {
- this.valueClass = 1;
- this.clientOptions = ringType(
- [],
- [
- { value: 0, name: '餐饮业' },
- { value: 0, name: '互联网' },
- { value: 0, name: '金融业' },
- { value: 0, name: '服务业' },
- ],
- {},
- { type: '', total: 0 }
- );
- } else if (window.screen.width == 2560 || window.screen.width > 1920) {
- this.valueClass = 2;
- this.clientOptions = ringTypeEnlarge(
- [],
- [
- { value: 0, name: '餐饮业' },
- { value: 0, name: '互联网' },
- { value: 0, name: '金融业' },
- { value: 0, name: '服务业' },
- ],
- {},
- { type: '', total: 0 }
- );
- }
- this.getData();
- }
- };
- </script>
- <style lang="scss" scoped>
- @import '../style.scss';
- @import '../stylePc.scss';
- .fonst-color {
- color: #fff;
- }
- </style>
|