| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <template>
- <transition
- appear
- name="animate__animated animate__move"
- enter-active-class="animate__slideInLeft"
- leave-active-class="animate__slideOutLeft"
- >
- <div class="widget-ContractInfo" v-if="show">
- <div class="head">
- <div class="title">
- <div class="icon"></div>
- <span class="site-info">合同情况</span>
- </div>
- </div>
- <div class="content-info">
- <div class="content-item">
- <div class="title">
- <div class="icon"></div>
- <span class="item-name">建管项目:</span>
- <span class="item-info">项目数量{{ ProjectTotal }}个,累计完成产值{{ TotalValue }}亿</span>
- </div>
- <div class="content">
- <div class="chart-container">
- <div class="chart-title">完成占比:8.3%</div>
- <ComThreeDimensionsChart v-on="$listeners" />
- <!-- 底座背景 -->
- <div class="bg"></div>
- </div>
- <div class="dataInfo">
- <div
- class="data-item"
- v-for="(item, index) of staList"
- :key="item.name"
- :style="index === 0 ? 'background: rgba(11, 122, 192,0.16)' : 'background: rgba(8, 178, 114,0.16)'"
- >
- <div class="pointSymbol" :style="index === 0 ? 'background:#2BA7FF' : 'background:#13D28A'"></div>
- <div class="data-title">{{ item.name }}</div>
- <div class="data-value">{{ item.value }}{{ item.unit }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="content-item">
- <div class="title">
- <div class="icon"></div>
- <span class="item-name">EPC项目:</span>
- <span class="item-info">总投资{{ EPCInvestNum }}亿</span>
- </div>
- <div class="content epc">
- <ComBatteryChart :chartData="EPCData" v-on="$listeners" />
- </div>
- </div>
- <div class="content-item">
- <div class="title">
- <div class="icon"></div>
- <span class="item-name">近6个月数据(万元)</span>
- <span class="item-info"></span>
- </div>
- <div class="content">
- <ComLineChart :chartData="latestData" />
- </div>
- </div>
- </div>
- </div>
- </transition>
- </template>
- <script>
- import ComThreeDimensionsChart from '@/views/groupPage/components/ComThreeDimensionsChart.vue'
- import ComBatteryChart from '@/views/groupPage/components/ComBatteryChart.vue'
- import ComLineChart from '@/views/groupPage/components/ComLineChart.vue'
- export default {
- name: 'ContractInfo', //合同情况
- components: {
- ComThreeDimensionsChart,
- ComBatteryChart,
- ComLineChart
- },
- props: {
- show: {}
- },
- data() {
- return {
- staList: [
- { name: '本年投资计划', value: 0, unit: '亿' },
- { name: '本年累计完成产值', value: 0, unit: '亿' }
- ],
- //建管项目
- ProjectTotal: 0, //项目总数
- TotalValue: 0, //累计完成产值
- //EPC
- EPCInvestNum: 0, //EPC项目投资数
- EPCData: {
- spending: 0,
- income: 0,
- profits: 0
- }, //EPC收支信息
- latestData: {
- income: [],
- spending: [],
- profits: []
- }
- }
- },
- watch: {
- show: {
- handler(n, o) {}
- }
- },
- computed: {
- setNoNull() {
- return this.$listeners.setNullAndUndefinedEmpty
- }
- },
- mounted() {
- this.getPageData()
- },
- methods: {
- roundFun(value, n) {
- return Math.round(value * Math.pow(10, n)) / Math.pow(10, n)
- },
- getPageData() {
- const { getRequestResult } = this.$listeners
- let data = { blockCode: 'ycepclist' }
- //获取全部数据
- getRequestResult(data).then((res) => {
- res = res.map((item) => {
- return {
- ...item,
- indexValue:
- item.unit === '万元'
- ? this.roundFun(this.setNoNull(item.indexValue) / 10000, 2)
- : this.setNoNull(item.indexValue)
- }
- })
- //获取项目数据
- this.ProjectTotal = res.filter((item) => item.indexCode === 'A1')[0].indexValue
- this.TotalValue = res.filter((item) => item.indexCode === 'A5')[0].indexValue
- this.staList[0].value = res.filter((item) => item.indexCode === 'A6')[0].indexValue
- this.staList[1].value = res.filter((item) => item.indexCode === 'A7')[0].indexValue
- //获取EPC数据
- this.EPCInvestNum = res.filter((item) => item.indexCode === 'A4')[0].indexValue
- this.EPCData = {
- spending: res.filter((item) => item.indexCode === 'A10')[0].indexValue,
- income: res.filter((item) => item.indexCode === 'A9')[0].indexValue,
- profits:
- res.filter((item) => item.indexCode === 'A9')[0].indexValue -
- res.filter((item) => item.indexCode === 'A10')[0].indexValue
- }
- //获取近六个月数据
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A47')[0].indexValue)
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A50')[0].indexValue)
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A53')[0].indexValue)
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A56')[0].indexValue)
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A59')[0].indexValue)
- this.latestData.income.push(res.filter((item) => item.indexCode === 'A62')[0].indexValue)
- //
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A48')[0].indexValue)
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A51')[0].indexValue)
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A54')[0].indexValue)
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A57')[0].indexValue)
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A60')[0].indexValue)
- this.latestData.spending.push(res.filter((item) => item.indexCode === 'A63')[0].indexValue)
- //
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A49')[0].indexValue)
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A52')[0].indexValue)
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A55')[0].indexValue)
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A58')[0].indexValue)
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A61')[0].indexValue)
- this.latestData.profits.push(res.filter((item) => item.indexCode === 'A64')[0].indexValue)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .animate__slideInLeft,
- .animate__slideOutLeft {
- animation-duration: 3s; //动画持续时间
- animation-delay: 0s; //动画延迟时间
- }
- .widget-ContractInfo {
- $size10: 0.052083rem /* 10/192 */;
- $size20: 0.104167rem /* 20/192 */;
- z-index: 2;
- //position
- bottom: $size10 /* 10/192 */;
- margin-left: $size20 /* 20/192 */;
- position: absolute;
- //size
- height: calc(100% - 0.557292rem /* 107/192 */);
- width: 2.083333rem /* 400/192 */;
- //background
- // background-color: rgba(20, 24, 47, 0.5);
- color: #eee;
- // box-shadow: 0 0 20px rgba(1, 9, 20, 1);
- //font
- // font-family: Source Han Sans CN-HEAVY;
- .head {
- height: 0.166667rem /* 32/192 */;
- width: 100%;
- background: linear-gradient(-90deg, rgba(43, 167, 255, 0.2) 0%, rgba(43, 167, 255, 0.08) 100%);
- font-family: Source Han Sans CN-HEAVY;
- .title {
- width: 100%;
- height: 100%;
- display: flex;
- font-weight: 400;
- align-items: center;
- .icon {
- height: 0.166667rem /* 32/192 */;
- width: 0.34375rem /* 66/192 */;
- background: url('~@/views/groupPage/images/模块图标/合同情况.png') no-repeat center center;
- background-size: 100% 100%;
- }
- span {
- flex: 1;
- font-weight: bold;
- font-size: 0.083333rem /* 16/192 */;
- color: #ffffff;
- padding: 0.041667rem /* 8/192 */;
- background: linear-gradient(0deg, #9bd2fa 0%, #ffffff 100%);
- background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- .el-select {
- flex: 0.4;
- /deep/ input {
- padding: 0;
- background: transparent;
- border: none;
- font-size: 0.072917rem /* 14/192 */;
- font-weight: 500;
- color: #2ba7ff;
- }
- /deep/ .el-icon-arrow-up:before {
- content: '';
- display: block;
- // 定义元素宽高
- margin-top: 0.041667rem /* 8/192 */;
- width: 0.130208rem /* 25/192 */;
- height: 0.078125rem /* 15/192 */;
- background: url('~@/views/groupPage/images/三角下.png') no-repeat center center;
- background-size: 100% 100%;
- transform: rotate(180deg);
- }
- }
- .datePicker {
- position: absolute;
- left: 1.041667rem /* 200/192 */;
- top: 0.182292rem /* 35/192 */;
- .el-range-editor--mini.el-input__inner {
- width: 1.041667rem /* 200/192 */;
- height: 0.145833rem /* 28/192 */;
- }
- /deep/ .el-date-editor .el-range-input {
- width: 100%;
- }
- }
- }
- }
- .content-info {
- width: 100%;
- height: calc(100% - 0.166667rem);
- overflow: auto;
- padding: 2px;
- font-family: Source Han Sans CN-MEDIUM;
- .content-item {
- width: 100%;
- height: 33%;
- float: left;
- overflow: hidden;
- .title {
- width: 100%;
- display: flex;
- // padding: .145833rem 0 .104167rem 0;
- padding: 0.145833rem 0 0.026042rem /* 5/192 */ 0;
- .icon {
- height: 0.072917rem /* 14/192 */;
- width: 0.078125rem /* 15/192 */;
- margin-right: 0.046875rem /* 9/192 */;
- background: url('~@/views/groupPage/images/三角.png') no-repeat center center;
- background-size: 100% 100%;
- }
- .item-name {
- color: #ffffff;
- font-size: 0.072917rem /* 14/192 */;
- font-weight: 500;
- }
- .item-info {
- color: #2ba7ff;
- font-size: 0.072917rem /* 14/192 */;
- font-weight: 500;
- }
- }
- .content {
- height: calc(100% - 0.234375rem /* 45/192 */);
- width: 100%;
- display: flex;
- .chart-container {
- width: 50%;
- .chart-title {
- position: absolute;
- left: 0.234375rem /* 45/192 */;
- font-size: 0.083333rem /* 16/192 */;
- font-family: Source Han Sans CN;
- font-weight: bold;
- top: 0.520833rem /* 100/192 */;
- color: #ffffff;
- }
- .bg {
- width: 100%;
- height: 100%;
- }
- .bg {
- position: absolute;
- top: 0.614583rem /* 118/192 */;
- left: 0.041667rem /* 8/192 */;
- z-index: -1;
- width: 0.9375rem /* 180/192 */;
- height: 0.807292rem /* 155/192 */;
- background: no-repeat center;
- background-image: url('~@/views/groupPage/images/底座样式.png');
- background-size: 100% 100%;
- }
- }
- .dataInfo {
- width: 50%;
- display: flex;
- flex-flow: column;
- justify-content: space-around;
- font-family: Source Han Sans CN;
- .data-item {
- display: flex;
- align-items: center;
- padding: 0.052083rem /* 10/192 */;
- color: #ffffff;
- height: 0.338542rem /* 65/192 */;
- .pointSymbol,
- .data-title {
- margin-right: 0.052083rem /* 10/192 */;
- white-space: nowrap;
- }
- .pointSymbol {
- border-radius: 50%;
- height: 0.052083rem /* 10/192 */;
- width: 0.052083rem /* 10/192 */;
- }
- .data-title {
- font-size: 0.072917rem /* 14/192 */;
- font-weight: 400;
- color: #ffffff;
- }
- .data-value {
- font-size: 0.083333rem /* 16/192 */;
- font-family: Source Han Sans CN-HEAVY;
- font-weight: bold;
- color: #ffffff;
- position: absolute;
- right: 2%;
- }
- }
- }
- }
- .epc {
- background: rgba(14, 167, 255, 0.08);
- margin-top: 0.15625rem /* 30/192 */;
- }
- }
- }
- }
- </style>
|