| ÎļþÃû´Ó src/views/mdc/components/recordCharts.vue ÐÞ¸Ä |
| | |
| | | <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]); |
| | |
| | | }) |
| | | newData.push(...item.statusRecordList); |
| | | }) |
| | | this.total = res.data.total; |
| | | //渲æå¾è¡¨ |
| | | this.setCharts(yAxisData,newData); |
| | | // æ£æ¥æ¯å¦åå¨id为'parentNodeDom'çDOMå
ç´ ,æå°±å
å é¤ |
| | |
| | | } |
| | | } |
| | | 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> |
| | |
| | | <style scoped> |
| | | #record { |
| | | position: relative; |
| | | margin-bottom: 120px; |
| | | } |
| | | #record /deep/ .domSpan { |
| | | display: inline-block; |
| | |
| | | display: inline-block; |
| | | width: 80px; |
| | | } |
| | | .pagination { |
| | | text-align: right; |
| | | display: flex; |
| | | justify-content: end; |
| | | margin-top: -60px; |
| | | position: relative; |
| | | z-index: 99; |
| | | } |
| | | </style> |