main.vue 3.2 KB
<!--
 * @Description: 
 * @Author: jml
 * @Date: 2021-02-26 15:38:10
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-07-01 14:30:15
-->
<template>
  <div class="xrk-components-bi bi" :class="{ 'bi-print': print }">
    <template v-if="projectType == 20">
      <BiConfigurableMobile v-if="mobile"></BiConfigurableMobile>
      <BiConfigurable v-else></BiConfigurable>
    </template>
    <template v-if="projectType == 6">
      <BiZoneMobile v-if="mobile"></BiZoneMobile>
      <BiZone v-else></BiZone>
    </template>
  </div>
</template>

<script>
import mixin from './mixin/index';
import BiConfigurable from './project/20-configurable.vue';
import BiConfigurableMobile from './project/20-configurable-mobile.vue';
import BiZone from './project/6-zone.vue';
import BiZoneMobile from './project/6-zone-mobile.vue';

export default {
  name: 'XrkBi',
  mixins: [mixin],
  provide() {
    return {
      Bi: this
    };
  },
  props: {
    mobile: [Number, String, Boolean],
    print: [Number, String, Boolean],
    projectType: [Number, String],
    getBaseInfo: {
      type: Function,
      default: () => {}
    },
    getFixedInfo: {
      type: Function,
      default: () => {}
    },
    getTopicInfo: {
      type: Function,
      default: () => {}
    },
    getGroupInfo: {
      type: Function,
      default: () => {}
    },
    saveInfo: {
      type: Function,
      default: () => {}
    },
    exportBi: {
      type: Function,
      default: () => {}
    },
    getTemplateList: {
      type: Function,
      default: () => {}
    }
  },
  components: {
    BiConfigurable,
    BiConfigurableMobile,
    BiZone,
    BiZoneMobile
  },
  methods: {
    setFontSize() {
      if (this.isMobile) {
        document.getElementsByTagName('html')[0].style.fontSize =
          this.baseFontSize + 'px';
      }
    }
  },
  created() {
    this.setFontSize();
  }
};
</script>
<style lang="scss">
body,
p,
div {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.custom-dialog {
  .el-dialog {
    border-radius: 12px;
    &__header {
      text-align: center;
      font-size: 24px;
      color: #333333;
    }
    &__body {
      text-align: center;
    }
    &__footer {
      text-align: center;
      .el-button {
        width: 82px;
        height: 33px;
        line-height: 33px;
        padding: 0;
      }
    }
  }
}
.bi {
  &-block {
    width: 1200px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #f4f4f4;
    background: #fff;
    &.no-border {
      border-color: transparent;
      background: transparent;
    }
  }
}
.bi-web-hr {
  width: 100%;
  height: 23px;
  height: 0.4rem;
  max-height: 23px;
  background-color: #f9fafc;
}
.mobile {
  .bi-web-hr {
    width: 10rem;
    height: 0.4rem;
  }
  &.bi-block {
    width: 10rem;
  }
}
</style>
<style lang="scss" scoped>
.xrk-components-bi {
  width: 1200px;
  // background-color: red;
  background: #f9fafc;
  line-height: 1;
  position: relative;
  &.bi-print {
    &::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      z-index: 11;
      background-image: url('http://cdn.yxvzb.com/WEB/SaaS/images/bi/watermark.png');
      background-repeat: repeat;
    }
  }
}
</style>