| | |
| | | <template> |
| | | <div ref="workChart"> |
| | | <a-modal :title="title" :getContainer="() => this.$refs.workChart" width="80%" wrap-class-name="full-modal" :footer="null" :visible="visible" |
| | | <a-modal :title="title" :getContainer="() => this.$refs.workChart" width="80%" wrap-class-name="full-modal" |
| | | :footer="null" :visible="visible" |
| | | @cancel="handleCancel" cancelText="关闭"> |
| | | <div> |
| | | <div> |
| | |
| | | export default { |
| | | name: 'WorkChartModel', |
| | | components: {}, |
| | | props: {}, |
| | | props: { |
| | | collectTime: { |
| | | type: Object |
| | | }, |
| | | equipment: { |
| | | type: Object |
| | | } |
| | | }, |
| | | watch: { |
| | | // 监控父组件点击左右箭头切换的时间值将其赋给点击工作曲线后的时间选择器的值 |
| | | collectTime: { |
| | | handler(newVal) { |
| | | this.currentToggledTime = newVal |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | spinning:false, |
| | |
| | | url: { |
| | | initPlainOptions: '/mdc/mdcDriveTypeParamConfig/findWorkCurveParamList', |
| | | workChart: '/mdc/mdcEquipmentRunningSection/workChart' |
| | | } |
| | | }, |
| | | currentToggledTime: '', |
| | | isClicklogListRow: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableRowRecord', this.getLogListRowRecord) |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | disabledDate(current){ |
| | | //Can not slect days before today and today |
| | | return current && current > moment().endOf("day"); |
| | | return current && current > moment().endOf('day') |
| | | }, |
| | | initPlainOptions(param) { |
| | | let that = this |
| | |
| | | temp.push({ label: item.chineseName, value: item.id, englishName: item.englishName }) |
| | | } |
| | | that.plainOptions = temp |
| | | |
| | | if(temp.length>0){ |
| | | that.option = [temp[0].value] |
| | | let param = { |
| | | driveType: that.node.driveType, |
| | | equipmentId: that.node.equipmentId, |
| | | date: that.queryParams.paramDateStr, |
| | | start: that.queryParams.startStr, |
| | | end: that.queryParams.endStr, |
| | | interval: that.queryParams.period, |
| | | codeTypeId: that.option.join(',') |
| | | } |
| | | that.initChart(param) |
| | | } |
| | | } |
| | | }) |
| | |
| | | end: this.queryParams.endStr, interval: this.queryParams.period, |
| | | codeTypeId: this.option.join(',') |
| | | } |
| | | this.initChart(param); |
| | | this.spinning = true; |
| | | this.initChart(param) |
| | | this.spinning = true |
| | | }, |
| | | timeHandleChange(val) { |
| | | if (val == 'start') { |
| | |
| | | let _this = this |
| | | this.visible = true |
| | | this.node = node |
| | | let paramDate = moment() |
| | | let start = moment('0:0', 'HH:mm') |
| | | let end = moment(moment().format('HH:mm'), 'HH:mm') |
| | | this.spinning = true |
| | | let paramDate |
| | | let start |
| | | let end |
| | | // 当没有切换过时间currentToggledTime的值为空值,如果由于点击左右箭头切换过时间,则currentToggledTime为切换后的时间 |
| | | if (!this.currentToggledTime) { |
| | | paramDate = moment() |
| | | } else { |
| | | paramDate = this.currentToggledTime |
| | | } |
| | | // 判断是否点击设备日志表格行的数据,若点击表格数据则显示表格数据中的时间,若点击工作曲线图片则显示0点至当前时间数据 |
| | | if (this.isClicklogListRow) { |
| | | start = node.start |
| | | end = node.end |
| | | } else { |
| | | start = moment('0:0', 'HH:mm') |
| | | end = moment(moment().format('HH:mm'), 'HH:mm') |
| | | } |
| | | this.queryParams = { |
| | | equipmentId: node.equipmentId, |
| | | equipmentName: node.equipmentName, |
| | |
| | | } |
| | | this.$nextTick(() => { |
| | | _this.initPlainOptions(node) |
| | | let param = { |
| | | driveType: node.driveType, equipmentId: node.equipmentId, |
| | | date: _this.queryParams.paramDateStr, start: _this.queryParams.startStr, |
| | | end: _this.queryParams.endStr, interval: _this.queryParams.period, |
| | | codeTypeId: _this.option.join(',') |
| | | } |
| | | _this.initChart(param) |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false; |
| | | this.stratOpen = false; |
| | | this.endOpen = false; |
| | | this.visible = false |
| | | this.stratOpen = false |
| | | this.endOpen = false |
| | | }, |
| | | checkboxOnChange(e) { |
| | | if (e.length <= 3) { |
| | |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:'最多只能选择三个' |
| | | }); |
| | | }) |
| | | return false |
| | | } |
| | | }, |
| | |
| | | this.show = false |
| | | }, |
| | | getYAxisOffset(index) { |
| | | return index * 50 + 10; |
| | | return index * 50 + 10 |
| | | }, |
| | | initChart(param) { |
| | | if (!this.workChart) { |
| | |
| | | } |
| | | }, |
| | | legend: { |
| | | data:[], |
| | | data: [] |
| | | }, |
| | | title: { |
| | | left: 'center', |
| | |
| | | position:'left', |
| | | boundaryGap: [0, '15%'], |
| | | axisLine:{ |
| | | show:true, |
| | | show: true |
| | | // lineStyle:{ |
| | | // color:'#000000' |
| | | // } |
| | |
| | | position:'left', |
| | | boundaryGap: [0, '15%'], |
| | | axisLine:{ |
| | | show:true, |
| | | show: true |
| | | // lineStyle:{ |
| | | // color:'#000000' |
| | | // } |
| | |
| | | position:'left', |
| | | boundaryGap: [0, '15%'], |
| | | axisLine:{ |
| | | show:true, |
| | | show: true |
| | | // lineStyle:{ |
| | | // color:'#000000' |
| | | // } |
| | | } |
| | | }, |
| | | } |
| | | ], |
| | | dataZoom: [ |
| | | { |
| | |
| | | type:'line', |
| | | data:[], |
| | | smooth:true, |
| | | symbol:'none', |
| | | symbol: 'none' |
| | | } |
| | | ] |
| | | } |
| | |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:'无数据!' |
| | | }); |
| | | this.spinning = false; |
| | | }) |
| | | this.spinning = false |
| | | _this.workChart.setOption(option,true) |
| | | }else{ |
| | | this.spinning = false; |
| | | this.spinning = false |
| | | // debugger |
| | | let result = [] |
| | | let itemLine = [] |
| | | //y轴数组 |
| | | var Yarr = [] |
| | | var lengenddata = []; |
| | | var lengenddata = [] |
| | | for (let i = 0; i < temp.length; i++) { |
| | | let item = temp[i] |
| | | itemLine = [] |
| | |
| | | yAxisIndex:i, |
| | | boundaryGap: [0,'100%'] |
| | | } |
| | | Yarr.push(Yline); |
| | | Yarr.push(Yline) |
| | | var line ={ |
| | | name:item.label, |
| | | type:'line', |
| | |
| | | |
| | | data:itemLine |
| | | } |
| | | result.push(line); |
| | | result.push(line) |
| | | |
| | | } |
| | | // option.yAxis = Yarr; |
| | | option.series = result; |
| | | option.legend = lengenddata; |
| | | option.series = result |
| | | option.legend = lengenddata |
| | | // console.log(option); |
| | | _this.workChart.setOption(option,true) |
| | | window.addEventListener('resize', function() { |
| | |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | /** |
| | | * 获取点击设备日志表格行后从兄弟组件传来的时间对象 |
| | | * @param timeObj 当前行的开始时间与结束时间组成的对象 |
| | | */ |
| | | getLogListRowRecord(timeObj) { |
| | | // 判断是否点击设备日志表格行的数据,此时为点击表格数据为true |
| | | this.isClicklogListRow = true |
| | | // 合并父组件传来的当前设备信息对象与兄弟组件传来的当前行的时间对象 |
| | | const newQueryParams = Object.assign(this.equipment, timeObj) |
| | | this.add(newQueryParams) |
| | | this.title = '工作曲线' |
| | | } |
| | | } |
| | | } |
| | |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | /deep/ .ant-modal{ |
| | | /*background-color: #000;*/ |
| | | /*color: #fff;*/ |
| | | } |
| | | |
| | | /deep/ .ant-modal-header{ |
| | | /*background-color: #000;*/ |
| | | } |
| | | |
| | | /deep/ .ant-modal-title{ |
| | | /*color: #fff;*/ |
| | | } |
| | | |
| | | /deep/ .ant-modal-close{ |
| | | color: #1191b0; |
| | | font-size: 24px; |
| | | } |
| | | |
| | | /deep/ .ant-modal-content{ |
| | | /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ |
| | | /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ |
| | |
| | | /*color: #fff;*/ |
| | | position: relative; |
| | | } |
| | | |
| | | /deep/ .ant-modal-header{ |
| | | /*border-bottom: none!important;*/ |
| | | } |
| | | |
| | | /deep/ .ant-checkbox-wrapper{ |
| | | /*color: #fff;*/ |
| | | } |
| | | |
| | | /deep/ .ant-form-item-label label{ |
| | | /*color: #fff;*/ |
| | | } |
| | | |
| | | /deep/ .ant-btn{ |
| | | /*position: absolute;*/ |
| | | |
| | | } |
| | | |
| | | .checkboxgroup{ |
| | | position: absolute; |
| | | right: 5%; |
| | |
| | | align-items: center; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | /deep/ .ant-checkbox-group{ |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | /deep/ .ant-checkbox-group .ant-checkbox-wrapper{ |
| | | padding: 10px; |
| | | } |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .workChart_params{ |
| | | display: flex; |
| | | /*align-items: center;*/ |
| | | flex-direction: column; |
| | | float: left; |
| | | } |
| | | |
| | | .workChart_params .params_one{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .workChart_params .params_two{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | /deep/ .workChart_params .ant-form-item{ |
| | | display: flex; |
| | | } |
| | | |
| | | /deep/ .workChart_params .ant-form-item .ant-form-item-control-wrapper{ |
| | | margin: 0 10px; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | .ant-btn { |
| | | padding: 0 10px; |