123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view class="content">
- <!-- <div class="bigtitle">
- <h2>
- {{indexTitle}}
- </h2>
- </div> -->
- <view>
- <cyChart v-for="item in echartsData" :key="item.id" :chartType="item.chartType" :chartId="item.id"> </cyChart>
- </view>
- <u-empty text="暂无数据" icon="../../static/data.png" v-if="!echartsData.length"></u-empty>
- </view>
- </template>
- <script>
- import {
- nowDate,
- timeToDate,
- getLastWeek,
- getLastMonth,
- getLast3Month
- } from '../../utils/date.js'
- import cyChart from '../../components/cycharts/cyChart.vue';
- export default {
- components: {
- cyChart
- },
- data() {
- return {
- indexTitle: '',
- queryParams: {
- page: 1,
- limit: 999
- },
- //图表数据
- echartsData: [],
- }
- },
- created() {
-
- },
- mounted() {
- this.loadTitle();
- this.initData()
- },
- onPullDownRefresh() {
- this.loadTitle()
- this.initData()
- },
- methods: {
- //获得首页标题
- loadTitle() {
- uni.$http.get('/dict/queryByDictKey?dictKeys=title').then(res => {
- const data = res.data
- if (data.code === 200) {
- this.indexTitle = data.data[0].dictValue;
- uni.setNavigationBarTitle({
- title:this.indexTitle
- })
- }
- })
- },
- initData() {
- uni.removeStorage('sTime')
- this.clear = true
- this.value = null
- this.choiceTime = 0
- this.startTime = timeToDate(new Date().getTime())
- this.temperature()
- },
- //用户图表数据
- temperature() {
- this.echartsData = []
- uni.$http.get('/chart/getAllOkChart', this.queryParams).then(res => {
- const data = res.data
- if (data.code === 200) {
- const {
- reportTableList
- } = data.data
- let array = []
- for (let i = 0; i < reportTableList.length; i++) {
- array.push({
- id: reportTableList[i].id,
- chartType: reportTableList[i].chartType,
- chartName: reportTableList[i].chartName,
- })
- }
- this.echartsData = array
- }
- })
- uni.stopPullDownRefresh()
- },
- }
- };
- </script>
- <style scoped>
- .container {
- height: 120vh
- }
- .title {
- margin: 10rpx 0 10rpx 20rpx;
- font-size: 28rpx;
- color: #666666;
- }
- ::v-deep .uni-section-content {
- width: 50%;
- margin-bottom: 20rpx;
- }
- ::v-deep .uni-list-item__content-title {
- font-size: 36rpx;
- }
- .moreTime {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 80vw;
- margin: auto
- }
- .bigtitle {
- margin: auto;
- text-align: center;
- }
- .bigtitle h2 {}
- .bod {
- border-bottom: 3px solid #007AFF;
- }
- .box {
- border: 1px solid #007AFF !important;
- }
- .childTime {
- margin: 16rpx 60rpx 0 60rpx;
- }
- .childTime>div {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .childTime>div>div {
- width: 140rpx;
- padding: 10rpx;
- border: 1px solid #e6e6e6;
- border-radius: 16rpx;
- color: #7e7e7e;
- font-size: 26rpx;
- text-align: center;
- }
- </style>
|