1
lzhe
2024-04-26 84a124a49844f2e8185acf6491861e4b43fa83c0
src/views/mdc/components/recordChartsByDate.vue
ÎļþÃû´Ó src/views/mdc/components/recordCharts.vue ÐÞ¸Ä
@@ -2,37 +2,49 @@
    <div>
        <div id="record" style="width: 100%;height:500px;"></div>
        <div class="pagination">
            <el-pagination layout="prev, pager, next" :total="total" :default-page-size="6"/>
            <el-pagination layout="prev, pager, next" @current-change="recordChange" :total="total" :default-page-size="6"/>
        </div>
        <save-dialog v-if="dialog.save" ref="saveDialog"  @success="addfeedbackSuccess" :workstationId="lastLevelId" @closed="dialog.save=false"></save-dialog>
    </div>
</template>
<script>
import saveDialog from '../add-station-status'
import moment from 'moment';
import * as echarts from 'echarts';
export default {
    components: {},
    components: {saveDialog},
    props: ['collectionstatus','date','workstationInfoList'],
    watch: {
        date(val) {
            this.current = "1";
            this.getCharts();
        },
        workstationInfoList(val) {
            this.current = "1";
            this.getCharts();
        }
    },
    data() {
        return {
            dialog: {
                save: false
            },
            current: "1",
            size: "6",
            total: 0,
            records: []
            records: [],
            lastLevelId: ""
        }
    },
    mounted() {
        this.getCharts();
    },
    methods: {
        addfeedbackSuccess() {
            this.current = "1";
            this.getCharts();
        },
        renderItem(params, api) {
            var categoryIndex = api.value(0);
            var start = api.coord([api.value(1), categoryIndex]);
@@ -100,6 +112,7 @@
                        })
                        newData.push(...item.statusRecordList);
                    })
                    this.total = res.data.total;
                    //渲染图表
                    this.setCharts(yAxisData,newData);
                    // æ£€æŸ¥æ˜¯å¦å­˜åœ¨id为'parentNodeDom'的DOM元素,有就先删除
@@ -258,13 +271,22 @@
                    }
                }
                dom.style.left = recordDom.offsetLeft  + "px";  //定位left
                var that = this;
                dom.addEventListener('click', function (event) {
                    console.log(event.target.dataset.code);
                   that.lastLevelId = event.target.dataset.id;
                   that.dialog.save = true
                    that.$nextTick(() => {
                        that.$refs.saveDialog.open('edit').setData(that.lastLevelId);
                    })
                    
                })
                parentNodeDom.appendChild(dom);
            }
        }
        },
        recordChange(current) {
            this.current = current;
            this.getCharts();
        },
    }
}
</script>
@@ -272,7 +294,6 @@
<style scoped>
    #record {
        position: relative;
        margin-bottom: 120px;
    }
    #record /deep/ .domSpan {
        display: inline-block;
@@ -286,4 +307,12 @@
        display: inline-block;
        width: 80px;
    }
    .pagination {
        text-align: right;
        display: flex;
        justify-content: end;
        margin-top: -60px;
        position: relative;
        z-index: 99;
    }
</style>