| | |
| | | this.getfeedBackStatusList(); //è·åç¶ælist |
| | | this.$HTTP.get(`/api/blade-cps/workstation-wcs-feedback/latest?workstationId=${lastLevelId}`).then(res=> { |
| | | if(res.code == 200) { |
| | | console.log(res.data); |
| | | if(res.data == null) { |
| | | this.isShow = false; |
| | | }else { |
| ÎļþÃû´Ó 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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div id="recordwork" style="width: 1000px;height:500px;"></div> |
| | | <div class="paginationwork"> |
| | | <el-pagination layout="prev, pager, next" @current-change="recordChange" :total="total" :default-page-size="6"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment'; |
| | | import * as echarts from 'echarts'; |
| | | export default { |
| | | 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: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getCharts(); |
| | | }, |
| | | methods: { |
| | | renderItem(params, api) { |
| | | var categoryIndex = api.value(0); |
| | | var start = api.coord([api.value(1), categoryIndex]); |
| | | var end = api.coord([api.value(2), categoryIndex]); |
| | | var height = api.size([0, 1])[1] * 0.6; |
| | | var rectShape = echarts.graphic.clipRectByRect( |
| | | { |
| | | x: start[0], |
| | | y: start[1] - height / 2, |
| | | width: end[0] - start[0], |
| | | height: height |
| | | }, |
| | | { |
| | | x: params.coordSys.x, |
| | | y: params.coordSys.y, |
| | | width: params.coordSys.width, |
| | | height: params.coordSys.height |
| | | } |
| | | ); |
| | | return ( |
| | | rectShape && { |
| | | type: 'rect', |
| | | transition: ['shape'], |
| | | shape: rectShape, |
| | | style: api.style() |
| | | } |
| | | ); |
| | | }, |
| | | getColor(name) { |
| | | var color = ''; |
| | | this.collectionstatus.forEach(item=> { |
| | | if(item.name == name) { |
| | | color = item.color; |
| | | } |
| | | }) |
| | | return color; |
| | | }, |
| | | getCharts() { |
| | | var obj = { |
| | | date: this.date, |
| | | humanFeedback: true, |
| | | machineFeedback: true, |
| | | workstationInfoList: this.workstationInfoList |
| | | } |
| | | this.$HTTP.post(`/api/blade-mdc/status-record/status-record-by-date?current=${this.current}&size=${this.size}`,obj).then(res => { |
| | | if (res.code === 200) { |
| | | var yAxisData = []; |
| | | var newData = []; |
| | | this.records = res.data.records; |
| | | res.data.records.reverse(); |
| | | res.data.records.forEach((item,index)=> { |
| | | yAxisData.push(item.workstationInfo.name); |
| | | //计ç®å¼å§æ¶é´ï¼æ¾ç¤ºæ¶é´ |
| | | item.statusRecordList.forEach(item1=> { |
| | | var initstart = item1.startTime.split(" ")[0]; //æ ¹æ®æ¥æè®¡ç®å·®å¼ |
| | | var startTime = moment(item1.startTime).diff(moment(initstart + " 00:00:00"), 'minutes'); |
| | | var endTime = moment(item1.endTime).diff(moment(initstart + " 00:00:00"), 'minutes'); |
| | | var diff = moment(item1.endTime).diff(moment(item1.startTime), 'minutes') //å¼å§äºå¤ä¹
|
| | | var color = this.getColor(item1.wcsDesc); |
| | | item1.value = [index,startTime,endTime,diff]; |
| | | item1.itemStyle = {"normal": {"color": color}}; |
| | | item1.code = item.workstationInfo.code; |
| | | item1.name = item.workstationInfo.name; |
| | | item1.id = item.workstationInfo.id; |
| | | }) |
| | | newData.push(...item.statusRecordList); |
| | | }) |
| | | this.total = res.data.total; |
| | | //渲æå¾è¡¨ |
| | | this.setCharts(yAxisData,newData); |
| | | } |
| | | }) |
| | | }, |
| | | setCharts(yAxisData,data) { |
| | | var option = { |
| | | tooltip: { |
| | | formatter: function (params) { |
| | | console.log(params) |
| | | return `<span class="tipdesc">å·¥ä½</span>${params.data.name}</br> |
| | | <span class="tipdesc">ç¶æ</span>${params.data.wcsDesc}</br> |
| | | <span class="tipdesc">æè¿°</span>${params.data.feedbackDesc}</br> |
| | | <span class="tipdesc">ç¶ææ¶é´</span>${params.data.startTime} ï½ ${params.data.endTime}</br> |
| | | <span class="tipdesc">å馿¶é´</span>${params.data.feedbackTime}</br> |
| | | <span class="tipdesc">åé¦äºº</span>${params.data.feedUser}</br>`; |
| | | } |
| | | }, |
| | | grid: { |
| | | top: 10, |
| | | left: 70, |
| | | bottom: 130, |
| | | right: 0 |
| | | }, |
| | | xAxis: { |
| | | min: 0, |
| | | max: 1440, // åä½åé |
| | | interval: 1440/6, //æ¯éå¤å°åéæ¾ç¤ºä¸ä¸ªå»åº¦ |
| | | axisLabel: { |
| | | formatter: (value)=> { |
| | | if(value == 0) { |
| | | return "00:00:00"; |
| | | }else if(value == 240) { |
| | | return "04:00:00"; |
| | | }else if(value == 480) { |
| | | return "08:00:00"; |
| | | }else if(value == 720) { |
| | | return "12:00:00"; |
| | | }else if(value == 960) { |
| | | return "16:00:00"; |
| | | }else if(value == 1200) { |
| | | return "18:00:00"; |
| | | }else if(value == 1440) { |
| | | return "00:00:00"; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'category', |
| | | data: yAxisData |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'custom', |
| | | renderItem: this.renderItem, |
| | | itemStyle: { |
| | | opacity: 0.8 |
| | | }, |
| | | encode: { |
| | | x: [1, 2], |
| | | y: 0 |
| | | }, |
| | | data: data |
| | | } |
| | | ] |
| | | }; |
| | | var recordDom = document.getElementById('recordwork'); |
| | | var myChart = echarts.init(recordDom); |
| | | myChart.setOption(option); |
| | | }, |
| | | recordChange(current) { |
| | | this.current = current; |
| | | this.getCharts(); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | #recordwork { |
| | | position: relative; |
| | | } |
| | | #recordwork /deep/ .domSpan { |
| | | display: inline-block; |
| | | width: 70px; |
| | | height: 20px; |
| | | /* background: green; */ |
| | | position: absolute; |
| | | cursor: pointer; |
| | | } |
| | | #recordwork /deep/ .tipdesc { |
| | | display: inline-block; |
| | | width: 80px; |
| | | } |
| | | .paginationwork { |
| | | text-align: right; |
| | | display: flex; |
| | | justify-content: end; |
| | | margin-top: -60px; |
| | | position: relative; |
| | | z-index: 99; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="footer"> |
| | | <el-button @click="query" type="primary">æ¥è¯¢</el-button> |
| | | <el-button>导åº</el-button> |
| | | <el-button @click="exportData">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="aposcope-right"> |
| | | <el-tabs tab-position="top" v-model="activeName" type="card"> |
| | | <el-tabs tab-position="top" v-model="activeName" type="card" @tab-change="tabChange"> |
| | | <el-tab-pane label="ææ¥ææ¥ç" name="shift"> |
| | | <el-button-group> |
| | | <el-button @click="changeTab(item)" :type="btnListActive == item.id ? 'primary' : ''" v-for="item in btnList" :key="item.id" size="small">{{item.title }}</el-button> |
| | |
| | | <!-- collectionstatus åé¦ç¶æ |
| | | date æ¥æ |
| | | workstationInfoList å·¥ä½list --> |
| | | <record-charts :collectionstatus="collectionstatus" :date="date" :workstationInfoList="workstationInfoList" v-if="collectionstatus.length != 0"></record-charts> |
| | | <record-charts-by-date :collectionstatus="collectionstatus" :date="date" :workstationInfoList="workstationInfoList" v-if="collectionstatus.length != 0"></record-charts-by-date> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æå·¥ä½æ¥ç" name="time"> |
| | | æå·¥ä½æ¥ç |
| | | <div class="fact-analysis-realtim"> |
| | | <div class="wimi-empty" style="background-color: rgb(255, 255, 255);" v-show="isshowempty"> |
| | | <div class="wimi-empty-img" style="width: 150px; height: 150px;"> |
| | | <img src="./quesheng.bd026700.png" style="height: auto; width: 100%;"> |
| | | </div> |
| | | <div class="empty-description"> |
| | | <div>ææ æ°æ®</div> |
| | | </div> |
| | | </div> |
| | | <div v-show="!isshowempty"> |
| | | <el-button-group> |
| | | <el-button @click="changeTabGongwei(item)" :type="btnGongweiListActive == item.id ? 'primary' : ''" v-for="item in btnGongweiList" :key="item.id" size="small">{{item.name }}</el-button> |
| | | </el-button-group> |
| | | <div class="status"> |
| | | <div class="status-wrap align-left"> |
| | | <div class="collect-status">ééç¶æ</div> |
| | | <div class="status-box" v-for="item in achievements"><div class="status-color" :style="{'background-color': item.color}"></div>{{ item.name }}</div> |
| | | </div> |
| | | <div class="status-wrap"> |
| | | <el-checkbox v-model="checked1" label="人工åé¦ç¶æ" size="large" /> |
| | | <div class="status-con"> |
| | | <div class="status-box" v-for="item in collectionstatus"><div class="status-color" :style="{'background-color': item.color}"></div>{{ item.name }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- collectionstatus åé¦ç¶æ |
| | | date æ¥æ |
| | | workstationInfoList å·¥ä½list --> |
| | | <record-charts-by-workstation :collectionstatus="collectionstatus" :date="date" :workstationInfoList="workstationInfoList" v-if="collectionstatus.length != 0"></record-charts-by-workstation> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | <script> |
| | | import moment from 'moment'; |
| | | import MYTree from './MYTree.vue'; |
| | | import recordCharts from './components/recordCharts.vue'; |
| | | import recordChartsByDate from './components/recordChartsByDate.vue'; |
| | | import recordChartsByWorkstation from './components/recordChartsByWorkstation.vue'; |
| | | export default { |
| | | components: { |
| | | time: "", |
| | | MYTree, |
| | | recordCharts |
| | | recordChartsByDate, |
| | | recordChartsByWorkstation |
| | | }, |
| | | watch: { |
| | | treeChecked(select) { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isshowempty: true, |
| | | select: [], |
| | | workstationInfoList: [], |
| | | date: "", |
| | | checked1: true, |
| | | btnListActive: '', |
| | | btnGongweiListActive: "", |
| | | btnList: [], |
| | | btnGongweiList: [], |
| | | timeBtn: "", |
| | | shortcuts: [ |
| | | { |
| | |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | tabChange(val) { |
| | | if(val == "time") { //æå·¥ä½æ¥ç |
| | | |
| | | }else if(val == "shift") { //ææ¥ææ¥ç |
| | | |
| | | } |
| | | }, |
| | | exportData() { //å¯¼åº |
| | | var obj = { |
| | | endTime: this.time[1], |
| | | startTime: this.time[0], |
| | | workstationInfoList: this.workstationInfoList |
| | | } |
| | | this.$HTTP.post(`/api/blade-mdc/status-record/excel/export`,obj).then(res=> { |
| | | if(res.code == 200) { |
| | | window.open(res.data.link); |
| | | } |
| | | }) |
| | | }, |
| | | changeTab(item) { |
| | | this.btnListActive = item.id; |
| | | this.date = item.id; |
| | | }, |
| | | changeTabGongwei(item) { //æå·¥ä½æ¥è¯¢ |
| | | |
| | | }, |
| | | getachievements() { //çæ¬¡ç¶æè®°å½ééç¶æ |
| | | this.$HTTP.get(`/api/blade-cps/global_wcs/wcs-achievements`).then(res=> { |
| | |
| | | query() { |
| | | this.getTime({endDate: this.time[1],startDate: this.time[0],statisticalMethod: 'SHIFT'}); |
| | | this.workstationInfoList = this.select; |
| | | if(this.select.length != 0) { //éäºå¼æ¾ç¤ºå·¥ä½ |
| | | this.btnGongweiList = this.select; |
| | | this.btnGongweiListActive = this.btnGongweiList[0].id; |
| | | this.isshowempty = false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | .status-wrap /deep/ .el-checkbox.el-checkbox--large { |
| | | color: #3b8e8e; |
| | | } |
| | | .pagination { |
| | | text-align: right; |
| | | .fact-analysis-realtim { |
| | | display: flex; |
| | | justify-content: end; |
| | | flex-direction: row; |
| | | flex-wrap: wrap; |
| | | justify-content: flex-start; |
| | | align-content: flex-start; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | height: 500px; |
| | | } |
| | | .wimi-empty { |
| | | height: 100%; |
| | | width: 100%; |
| | | display: flex; |
| | | border-radius: 2px; |
| | | flex-direction: column; |
| | | flex-wrap: nowrap; |
| | | align-content: center; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | .empty-description { |
| | | margin-bottom: 20px; |
| | | font-size: 14px; |
| | | color: #5e6d82; |
| | | margin-top: -16px; |
| | | line-height: 28px; |
| | | } |
| | | </style> |