| | |
| | | <!-- |
| | | * ......................................&&......................... |
| | | * ....................................&&&.......................... |
| | | * .................................&&&&............................ |
| | | * ...............................&&&&.............................. |
| | | * .............................&&&&&&.............................. |
| | | * ...........................&&&&&&....&&&..&&&&&&&&&&&&&&&........ |
| | | * ..................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.............. |
| | | * ................&...&&&&&&&&&&&&&&&&&&&&&&&&&&&&................. |
| | | * .......................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&......... |
| | | * ...................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&............... |
| | | * ..................&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&............ |
| | | * ...............&&&&&@ &&&&&&&&&&..&&&&&&&&&&&&&&&&&&&........... |
| | | * ..............&&&&&&&&&&&&&&&.&&....&&&&&&&&&&&&&..&&&&&......... |
| | | * ..........&&&&&&&&&&&&&&&&&&...&.....&&&&&&&&&&&&&...&&&&........ |
| | | * ........&&&&&&&&&&&&&&&&&&&.........&&&&&&&&&&&&&&&....&&&....... |
| | | * .......&&&&&&&&.....................&&&&&&&&&&&&&&&&.....&&...... |
| | | * ........&&&&&.....................&&&&&&&&&&&&&&&&&&............. |
| | | * ..........&...................&&&&&&&&&&&&&&&&&&&&&&&............ |
| | | * ................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&............ |
| | | * ..................&&&&&&&&&&&&&&&&&&&&&&&&&&&&..&&&&&............ |
| | | * ..............&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&....&&&&&............ |
| | | * ...........&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&......&&&&............ |
| | | * .........&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.........&&&&............ |
| | | * .......&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...........&&&&............ |
| | | * ......&&&&&&&&&&&&&&&&&&&...&&&&&&...............&&&............. |
| | | * .....&&&&&&&&&&&&&&&&............................&&.............. |
| | | * ....&&&&&&&&&&&&&&&.................&&........................... |
| | | * ...&&&&&&&&&&&&&&&.....................&&&&...................... |
| | | * ...&&&&&&&&&&.&&&........................&&&&&................... |
| | | * ..&&&&&&&&&&&..&&..........................&&&&&&&............... |
| | | * ..&&&&&&&&&&&&...&............&&&.....&&&&...&&&&&&&............. |
| | | * ..&&&&&&&&&&&&&.................&&&.....&&&&&&&&&&&&&&........... |
| | | * ..&&&&&&&&&&&&&&&&..............&&&&&&&&&&&&&&&&&&&&&&&&......... |
| | | * ..&&.&&&&&&&&&&&&&&&&&.........&&&&&&&&&&&&&&&&&&&&&&&&&&&....... |
| | | * ...&&..&&&&&&&&&&&&.........&&&&&&&&&&&&&&&&...&&&&&&&&&&&&...... |
| | | * ....&..&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...........&&&&&&&&..... |
| | | * .......&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&..............&&&&&&&.... |
| | | * .......&&&&&.&&&&&&&&&&&&&&&&&&..&&&&&&&&...&..........&&&&&&.... |
| | | * ........&&&.....&&&&&&&&&&&&&.....&&&&&&&&&&...........&..&&&&... |
| | | * .......&&&........&&&.&&&&&&&&&.....&&&&&.................&&&&... |
| | | * .......&&&...............&&&&&&&.......&&&&&&&&............&&&... |
| | | * ........&&...................&&&&&&.........................&&&.. |
| | | * .........&.....................&&&&........................&&.... |
| | | * ...............................&&&.......................&&...... |
| | | * ................................&&......................&&....... |
| | | * .................................&&.............................. |
| | | * ..................................&.............................. |
| | | --> |
| | | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-26 21:23:30 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/processParam/index.vue |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-28 19:51:45 |
| | | * @FilePath: /cps-web/src/views/mdc/processParam/index.vue |
| | | 实时看板 |
| | | --> |
| | | <template> |
| | |
| | | <el-aside width="300px" style="height: 100%;"> |
| | | <el-container> |
| | | <el-main class="nopadding"> |
| | | <el-row style="margin-top: 14px;"> |
| | | <el-row style="margin: 8px;font-size: 14px;"> |
| | | 工位 |
| | | </el-row> |
| | | <MYTree v-model="treeChecked" @loaded="query"></MYTree> |
| | |
| | | <el-col :span="4"> |
| | | <!-- <el-switch v-model="isShowTable" class="mb-2" active-text="数据表" inactive-text="统计图" /> --> |
| | | </el-col> |
| | | <el-col :span="20" style='text-align: right;'> |
| | | <el-col :span="18" style='text-align: right;'> |
| | | <el-date-picker :max-range="3" :clearable="true" value-format="YYYY-MM-DD" |
| | | style="width: 250px" v-model="time" type="daterange" range-separator="-" |
| | | start-placeholder="" end-placeholder="" :disabled-date="disabledDate" |
| | | @calendar-change="change" /> |
| | | </el-col> |
| | | <!-- <el-col :span="2" style='text-align: right;'> |
| | | <el-button type="primary" @click="exportExcel">导出</el-button> |
| | | </el-col> --> |
| | | </el-row> |
| | | <TimeLine v-model="timeRange" ref="timeLine"></TimeLine> |
| | | <el-collapse v-model="activeList"> |
| | | <el-collapse-item :title="item.description" :name="index" v-for="(item, index) in list" |
| | | <el-collapse-item :title="item.deLabel" :name="index" v-for="(item, index) in list" |
| | | :key="index"> |
| | | <div |
| | | v-if="(['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 1) || (!['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 0) && activeList.indexOf(index) > -1"> |
| | | <div> |
| | | <el-button size="small" @click="viewData(item)">查看数据</el-button> |
| | | </div> |
| | | <scEcharts style="width:100%" height="200px" :option="item?.dayCharts"> |
| | | <scEcharts style="width:100%" :height="item.height" :option="item?.dayCharts"> |
| | | </scEcharts> |
| | | </div> |
| | | <el-empty v-else description="暂无数据" /> |
| | |
| | | </div> |
| | | </template> |
| | | </el-drawer> |
| | | <scDialog v-model="visible"> |
| | | <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange"> |
| | | 全选 |
| | | </el-checkbox> |
| | | <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange"> |
| | | <el-checkbox v-for="city in list" :key="city.id" :label="city.id" :value="city.id"> |
| | | {{ city.description }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | <template #footer> |
| | | <el-button type="primary" @click="save">确定</el-button> |
| | | </template> |
| | | </scDialog> |
| | | </el-main> |
| | | </template> |
| | | |
| | |
| | | let min = moment(this.timeStart, 'YYYY-MM-DD').subtract(3, 'd').format('YYYY-MM-DD') |
| | | return !moment(Date).isBetween(min, max); |
| | | }, |
| | | visible: false, |
| | | checkAll: false, |
| | | isIndeterminate: false, |
| | | checkedCities: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | handleCheckAllChange(val) { |
| | | this.checkedCities = val ? this.list.map(v => v.id) : [] |
| | | this.isIndeterminate = false |
| | | }, |
| | | handleCheckedCitiesChange(value) { |
| | | console.log(value) |
| | | this.checkAll = value.length === this.list.length |
| | | this.isIndeterminate = value.length > 0 && value.length < this.list.length |
| | | }, |
| | | save() { |
| | | console.log(this.checkedCities) |
| | | this.$HTTP.post(`/api/mdc/process-parameter/excel/export`, { |
| | | collectItem: this.list.filter(v => this.checkedCities.includes(v.id)), |
| | | endTime: this.timeRange.endTime, |
| | | startTime: this.timeRange.startTime, |
| | | methodEnum: 'HOUR', |
| | | workstationId: this.treeChecked.toString(), |
| | | workstationName: '' |
| | | }).then(res => { |
| | | if (res.success) { |
| | | window.open(res.data.link) |
| | | } else { |
| | | this.$message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | exportExcel() { |
| | | this.checkAll = false |
| | | this.isIndeterminate = false |
| | | this.checkedCities = [] |
| | | this.visible = true |
| | | }, |
| | | init() { |
| | | this.$HTTP.get('/api/blade-mdc/process-parameter').then(res => { |
| | | this.$HTTP.get('/api/mdc/process-parameter').then(res => { |
| | | if (res.code === 200) { |
| | | this.legend = res.data |
| | | } |
| | | }) |
| | | }, |
| | | viewData(item) { |
| | | let data = { |
| | | FeedOverride: '进给倍率', |
| | | FeedSpeed: '进给速度', |
| | | SpindleOverride: '主轴倍率', |
| | | SpindleSpeed: '主轴转速', |
| | | Output: '产量', |
| | | ProcessProgram: '程序名', |
| | | DeviceStatus: '设备状态', |
| | | } |
| | | this.drawerName = data[item.name] |
| | | this.drawerName = item.dpLabel |
| | | |
| | | this.$HTTP.post('/api/blade-mdc/process-parameter/item?current=1&size=1500', { |
| | | this.$HTTP.post('/api/mdc/process-parameter/item?current=1&size=1500', { |
| | | endTime: this.timeRange.endTime, |
| | | startTime: this.timeRange.startTime, |
| | | item: item.name, |
| | |
| | | }) |
| | | }, |
| | | query() { |
| | | if (!this.treeChecked.toString()) return |
| | | console.log(this.treeChecked.toString(), '>>>>>>>>>/') |
| | | this.$refs?.timeLine?.init({ |
| | | dates: this.time, |
| | | workstationId: this.treeChecked.toString() |
| | | }) |
| | | this.$HTTP.get('/api/blade-mdc/process-parameter/param', { workstationId: this.treeChecked.toString() }).then(res => { |
| | | this.list = [] |
| | | this.$HTTP.get('/api/mdc/process-parameter/params', { workstationId: this.treeChecked.toString() }).then(res => { |
| | | if (res.code === 200) { |
| | | this.list = res.data |
| | | console.log('jkjkjkjkj', this.list) |
| | | this.list = res.data.map(v => { |
| | | let name = v.isProcessParam ? 'ProcessProgram' : v.dpName |
| | | return { |
| | | ...v, |
| | | name: name, |
| | | height: ['ProcessProgram', 'DeviceStatus'].includes(v.name) ? '100px' : '200px' |
| | | } |
| | | }) |
| | | this.queryChart() |
| | | } |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | queryChart1(item) { |
| | | let index = this.list.findIndex(item => item.name === 'DeviceStatus') |
| | | let index = this.list.findIndex(item => item.dpName === 'DeviceStatus') |
| | | this.list[index] = Object.assign({ |
| | | ...this.list[index], |
| | | dayCharts: {} |
| | | }) |
| | | this.$HTTP.post('/api/blade-mdc/process-parameter/chart/dmp-item', { |
| | | let params = { ...item } |
| | | try { |
| | | delete params.name |
| | | delete params.height |
| | | } catch (err) { console.error(err) } |
| | | this.$HTTP.post('/api/mdc/process-parameter/chart/dmp-item', { |
| | | methodEnum: "HOUR", |
| | | startTime: this.timeRange.startTime, |
| | | endTime: this.timeRange.endTime, |
| | | workstationId: this.treeChecked.toString(), |
| | | workstationName: '', |
| | | dmpDTO: { |
| | | dpDTO: { |
| | | id: this.treeChecked.toString(), |
| | | dmpDeviced: item.dmpDeviceId, |
| | | name: item.name, |
| | | description: item.description, |
| | | dataType: item.dataType, |
| | | wcsDataType: item.wcsDataType, |
| | | processParameter: item.processParameter |
| | | // name: item.name, |
| | | ...params |
| | | // dmpDeviced: item.dmpDeviceId, |
| | | // description: item.description, |
| | | // dataType: item.dataType, |
| | | // wcsDataType: item.wcsDataType, |
| | | // processParameter: item.processParameter |
| | | } |
| | | }).then(res => { |
| | | if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { |
| | | // if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { |
| | | if (item.paramChartType === 'distribute') { |
| | | this.setDeviceStatusOptions(res.data, item.name) |
| | | } else { |
| | | this.setLineOptions(res.data.data, item.name) |
| | |
| | | { |
| | | data: yAxisData, |
| | | type: 'line', |
| | | |
| | | step: 'start', |
| | | } |
| | | ], |
| | | xAxis: { |
| | |
| | | setDeviceStatusOptions(data, myname) { |
| | | let total = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) |
| | | let start = this.timeRange.startTime |
| | | let len = data.data.length |
| | | if (moment(data.data[len - 1].time).unix() < moment(this.timeRange.endTime).unix()) { |
| | | let len = data?.data?.length |
| | | if (len > 0 && moment(data.data[len - 1].time).unix() < moment(this.timeRange.endTime).unix()) { |
| | | let addItem = { |
| | | time: this.timeRange.endTime, |
| | | value: data.data[len - 1].value |