Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before into master
| | |
| | | url: '/mes/equipment/page/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function getDeviceId() { |
| | | return request({ |
| | | url: '/mes/mqtt/getDeviceId', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function mqttList(query) { |
| | | return request({ |
| | | url: '/mes/mqtt/mqttList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | var myChart = null |
| | | var option = null |
| | | |
| | | let base = +new Date(1968, 9, 3) |
| | | let oneDay = 24 * 3600 * 1000 |
| | | let date = [] |
| | | let data = [Math.random() * 300] |
| | | for (let i = 1; i < 20000; i++) { |
| | | var now = new Date((base += oneDay)) |
| | | date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/')) |
| | | data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1])) |
| | | } |
| | | |
| | | export default { |
| | | // props: { |
| | | // yAxisMonth: { |
| | | // type: Array, |
| | | // default: [] |
| | | // }, |
| | | // seriesData: { |
| | | // type: Array, |
| | | // default: [] |
| | | // } |
| | | // }, |
| | | props: { |
| | | yAxisMonth: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | seriesData: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | otherData: { |
| | | type: Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | option: { |
| | |
| | | }, |
| | | title: { |
| | | left: '5%', |
| | | text: 'Large Ara Chart' |
| | | text: '设备名称:' + this.otherData.deviceName + '\\单位:' + (this.otherData.unit ? this.otherData.unit : '') |
| | | }, |
| | | toolbox: { |
| | | right: '5%', |
| | |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: date |
| | | data: this.yAxisMonth |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | ], |
| | | series: [ |
| | | { |
| | | name: 'Fake Data', |
| | | name: '参数', |
| | | type: 'line', |
| | | symbol: 'none', |
| | | sampling: 'lttb', |
| | |
| | | } |
| | | ]) |
| | | }, |
| | | data: data |
| | | data: this.seriesData |
| | | } |
| | | ] |
| | | } |
| | |
| | | methods: { |
| | | makeOption() {}, |
| | | initDrag() { |
| | | myChart.setOption((option = this.option)) |
| | | myChart.setOption((option = this.option), true) |
| | | |
| | | option && myChart.setOption(option) |
| | | // 页面发生变化tree也改变 |
| | | window.addEventListener('resize', () => { |
| | | if (myChart) myChart.resize() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | // watch: { |
| | | // yAxisMonth: { |
| | | // handler(newVal) { |
| | | // console.log(`output->myChart`,myChart) |
| | | // setTimeout(()=>{ |
| | | // myChart.setOption((option = this.option), true) |
| | | // },100) |
| | | |
| | | // }, |
| | | // deep: true |
| | | // } |
| | | // } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | <div> |
| | | <div class="header_div"> |
| | | <el-select v-model="value" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <el-row> |
| | | <el-col |
| | | v-for="(v, k) in index" |
| | | :key="k" |
| | | style="height: 40vh; padding-top: 0.4em;" |
| | | :span="12" |
| | | ><largeAreaChart |
| | | /></el-col> |
| | | </el-row> |
| | | <basic-container> |
| | | <el-form label-width="100px" :inline="true"> |
| | | <el-form-item label="设备:" required> |
| | | <el-select |
| | | v-model="deviceId" |
| | | placeholder="请选择" |
| | | @change="getMqttLists" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.device_id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间:"> |
| | | <el-radio-group |
| | | v-model="checkboxGroup3" |
| | | size="small" |
| | | @change="destroyTimerAgainStart" |
| | | > |
| | | <el-radio-button v-for="city in cities" :label="city" :key="city">{{ |
| | | city |
| | | }}</el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | </basic-container> |
| | | <basic-container> |
| | | <div |
| | | v-if="!largeAreaChartList.length > 0" |
| | | style="height: 75vh; padding-top: 0.4em; display: flex; align-items: center; justify-content: center;" |
| | | > |
| | | 暂无数据 |
| | | </div> |
| | | <el-row> |
| | | <el-col |
| | | v-for="(v, k) in largeAreaChartList" |
| | | :key="k" |
| | | style="height: 40vh; padding-top: 0.4em;" |
| | | :span="12" |
| | | ><largeAreaChart |
| | | ref="largeAreaChartRef" |
| | | v-if="largeAreaChartList.length > 0" |
| | | :key="k" |
| | | :yAxisMonth="v.yAxisMonth" |
| | | :seriesData="v.listData" |
| | | :otherData="v" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | </basic-container> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import largeAreaChart from './components/largeAreaChart.vue' |
| | | import { getDeviceId, mqttList } from '@/api/equipment/equipment' |
| | | |
| | | export default { |
| | | components: { |
| | | largeAreaChart: largeAreaChart |
| | | }, |
| | | data() { |
| | | return { |
| | | index: 7, |
| | | options: [ |
| | | { |
| | | value: '选项1', |
| | | label: '黄金糕' |
| | | }, |
| | | { |
| | | value: '选项2', |
| | | label: '双皮奶' |
| | | }, |
| | | { |
| | | value: '选项3', |
| | | label: '蚵仔煎' |
| | | }, |
| | | { |
| | | value: '选项4', |
| | | label: '龙须面' |
| | | }, |
| | | { |
| | | value: '选项5', |
| | | label: '北京烤鸭' |
| | | } |
| | | ], |
| | | value: '' |
| | | largeAreaChartList: [], |
| | | cities: ['1 分钟', '3 分钟', '5 分钟', '10 分钟'], |
| | | checkboxGroup3: '1 分钟', |
| | | options: [], |
| | | deviceId: '', |
| | | timer: '' |
| | | } |
| | | }, |
| | | async created() { |
| | | await this.getDeviceIdFun() |
| | | this.getMqttLists() |
| | | }, |
| | | mounted() { |
| | | this.destroyTimerAgainStart() |
| | | }, |
| | | beforeDestroy() { |
| | | console.log(`output->销毁了定时器`) |
| | | clearInterval(this.timer) |
| | | }, |
| | | methods: { |
| | | async getDeviceIdFun() { |
| | | await getDeviceId().then((res) => { |
| | | this.options = res.data.data |
| | | this.deviceId = this.options[0].device_id |
| | | }) |
| | | }, |
| | | async getMqttLists() { |
| | | const obj = Object.assign({ |
| | | deviceId: this.deviceId, |
| | | collectionTime: this.checkboxGroup3.split(' ')[0] |
| | | }) |
| | | this.largeAreaChartList = [] |
| | | await mqttList(obj).then((res) => { |
| | | let data = res.data.data |
| | | data.forEach((i) => { |
| | | i.listData = [] |
| | | i.yAxisMonth = [] |
| | | if (i.listMqttTableData.length > 0) { |
| | | i.deviceId = i.listMqttTableData[0].deviceId |
| | | } |
| | | i.listMqttTableData.forEach((j) => { |
| | | i.listData.push(j.value) |
| | | i.yAxisMonth.push(j.collectionTime) |
| | | }) |
| | | i.listMqttTableData = [] |
| | | }) |
| | | this.largeAreaChartList = data |
| | | }) |
| | | }, |
| | | destroyTimerAgainStart() { |
| | | clearInterval(this.timer) |
| | | this.timer = setInterval( |
| | | this.getMqttLists, |
| | | 1000 * 60 * this.checkboxGroup3.split(' ')[0] |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .header_div { |
| | | height: 5em; |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 3em; |
| | | } |
| | | </style> |
| | | <style></style> |
| | |
| | | >刷新ifs车间订单号 |
| | | </el-button> --> |
| | | |
| | | <el-button |
| | | <!-- <el-button |
| | | v-if="permissions.manufacturingorder_export" |
| | | @click="exportExcel" |
| | | type="primary" |
| | | style="margin-left:10px;" |
| | | :loading="loadingExcel" |
| | | >导出 |
| | | </el-button> |
| | | </el-button> --> |
| | | <el-button |
| | | v-if="permissions.manufacturingorder_label_print" |
| | | @click="labelPrint" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="15"> |
| | | <el-col :span="14"> |
| | | <el-form-item label="计划时间" prop="localDateTimes"> |
| | | <el-date-picker :class="tattimest ? 'sed' : ''" v-model="dataForm.localDateTimes" |
| | | type="datetimerange" range-separator="至" start-placeholder="开始" end-placeholder="结束" |
| | |
| | | workCenter: [ |
| | | { required: true, message: '工作中心不能为空', trigger: 'change' } |
| | | ], |
| | | workstations: [ |
| | | workstationId: [ |
| | | { required: true, message: '工作站不能为空', trigger: 'change' } |
| | | ], |
| | | plannedQuantity: [ |
| | |
| | | <!-- <el-button class="tracking-out-revoke-btn" type="primary" icon="tracking-btn-out" |
| | | :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" >交班 |
| | | </el-button> --> |
| | | <!-- <el-button class="submit-out-btn" type="primary" |
| | | <el-button class="submit-out-btn" type="primary" |
| | | :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" @click="submitList()" |
| | | :loading="submitLoading">提交 |
| | | </el-button> --> |
| | | </el-button> |
| | | <el-button class="batch-out-del-btn" type="primary" |
| | | :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" @click="deleteList()">删除 |
| | | </el-button> |
| | |
| | | // render: { fun: this.addOrUpdateHandle } |
| | | } |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'state', |
| | | label: '状态', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'select', |
| | | formatter: this.formatInsState, |
| | | optList: () => { |
| | | return this.StateList |
| | | } |
| | | }, |
| | | // 检验编号 |
| | | { |
| | | minWidth: '140', |
| | |
| | | searchInfoType: 'datetimerange', |
| | | formatter: this.formatDateTime, |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'state', |
| | | label: '状态', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'select', |
| | | formatter: this.formatInsState, |
| | | optList: () => { |
| | | return this.StateList |
| | | } |
| | | }, |
| | | |
| | | // { |
| | | // minWidth: '120', |
| | | // prop: '', |
| | |
| | | |
| | | |
| | | // const url = 'https://ztms-mes.chinaztt.cn/' |
| | | // const url = 'http://localhost:9999' |
| | | const url = 'http://192.168.32.45:9999' |
| | | const url = 'http://localhost:9999' |
| | | //const url = 'http://192.168.32.45:9999' |
| | | |
| | | |
| | | const localUrl = 'http://localhost:8089' |