| | |
| | | WEB_SOCKET_URL: ''
|
| | | }
|
| | | export function getPlanList (params) {
|
| | | return ajax.post(HttpConstants.GET_PLANTLIST, params)
|
| | | return ajax.get(HttpConstants.GET_PLANTLIST, params)
|
| | | }
|
| | | // å½åç¨æ·
|
| | | export function initApplicationCfg() {
|
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 23:47:53 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-31 21:10:02 |
| | | * @LastEditTime: 2024-02-03 00:01:53 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/Map.vue |
| | | --> |
| | | <template> |
| | |
| | | <div class="map-container"> |
| | | <div class="table-tool"> |
| | | <slot name="tool"></slot> |
| | | <el-button v-show="!id" class="input" type="ghost" size="mini" @click="out">éåº</el-button> |
| | | <el-button class="input" type="ghost" size="mini" @click="save">ä¿å</el-button> |
| | | <el-button v-show="id" class="input" type="ghost" size="mini" @click="del">å é¤è¯¥å°å¾</el-button> |
| | | <span>è¡æ°:</span> |
| | | <el-input style="width: 70px;" class="input" v-show="status !== 2" v-model="rows" /> |
| | | <span>åæ°:</span> |
| | | <el-input style="width: 70px;" class="input" v-show="status !== 2" v-model="cols" /> |
| | | <!-- <el-button v-show="!id" class="input" type="ghost" size="mini" @click="out">éåº</el-button> --> |
| | | |
| | | <!-- <el-button v-show="id" class="input" type="ghost" size="mini" @click="del">å é¤è¯¥å°å¾</el-button> --> |
| | | <!-- <span>è¡æ°:</span> --> |
| | | <!-- <el-input style="width: 70px;" class="input" v-show="status !== 2" v-model="rows" /> --> |
| | | <!-- <span>åæ°:</span> --> |
| | | <!-- <el-input style="width: 70px;" class="input" v-show="status !== 2" v-model="cols" /> --> |
| | | <!-- <div class="plant-name" v-if="status===2">{{plantName}}</div> --> |
| | | <span>åç§°:</span> |
| | | <el-input style="width: 150px;" class="input" v-model="plantName" placeholder="请è¾å
¥å°å¾åç§°" /> |
| | | <el-button class="input" size="mini" type="primary" v-show="status !== 2" @click="createMap">çæå°å¾</el-button> |
| | | <el-input style="width: 150px;" class="input" v-model="plantName" placeholder="请è¾å
¥å°å¾åç§°" /> |
| | | <el-button class="input" type="ghost" size="mini" @click="save">ä¿å</el-button> |
| | | <!-- <el-button class="input" size="mini" type="primary" v-show="status !== 2" @click="createMap">çæå°å¾</el-button> --> |
| | | </div> |
| | | <div class="table" :class="$route.name === 'preview' ? 'active' : ''"> |
| | | <div class="table-actions" :style="position" v-show="showAction && status !== 2"> |
| | |
| | | <div :style="{ width: (cols * height + 'px'), height: rows * height + 'px' }"> |
| | | <table> |
| | | <tr v-for="(item, index) in map" :key="index"> |
| | | <td v-if="v.rowspan !== 0 && v.colspan !== 0" |
| | | :width="v.colspan * height + 'px'" |
| | | <td v-if="v.rowspan !== 0 && v.colspan !== 0" :width="v.colspan * height + 'px'" |
| | | :height="v.rowspan * height + 'px'" |
| | | :class="{ 'active': (range.x !== '' && v.rowIndex >= range.x && v.rowIndex <= range.x1 && v.colIndex >= range.y && v.colIndex <= range.y1), aisle: v.type === 1 }" |
| | | @mousedown="e => onMousedown(e, v)" |
| | | @mousemove="e => onMouseMove(e, v)" v-for="v in item" |
| | | @mousedown="e => onMousedown(e, v)" @mousemove="e => onMouseMove(e, v)" v-for="v in item" |
| | | :rowspan="v.rowspan" :colspan="v.colspan" :key="v.rowIndex + '-' + v.colIndex"> |
| | | <div class="td-div" :style="{width:v.colspan * height - 2 + 'px',height: v.rowspan * height - 2 + 'px',overflow:'hidden'}"> |
| | | <div class="td-div" |
| | | :style="{ width: v.colspan * height - 2 + 'px', height: v.rowspan * height - 2 + 'px', overflow: 'hidden' }"> |
| | | <img @click="addDevice($event, v)" @mousedown="e => e.stopPropagation()" |
| | | v-if="v.type === 2 && status !== 2 && !v.id" src="./img/+.png" alt="æ·»å æºåº" title="æ·»å æºåº"> |
| | | <Device v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" :deviceList="deviceList" |
| | | :plantDeviceList="plantDeviceList" ::info="info"></Device> |
| | | v-if="v.type === 2 && status !== 2 && !v.id" src="./img/+.png" alt="æ·»å æºåº" |
| | | title="æ·»å æºåº"> |
| | | <Device v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" |
| | | :deviceList="deviceList" :plantDeviceList="plantDeviceList" ::info="info"></Device> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog class="add-device" title="æ¾ç½®è®¾å¤" top="94px" :close-on-click-modal="false" width="400px" :visible.sync="addStatus" > |
| | | <el-dialog class="add-device" title="æ¾ç½®è®¾å¤" top="94px" :close-on-click-modal="false" width="400px" |
| | | :visible.sync="addStatus" @close="addStatus = false"> |
| | | <el-select class="wkshoplist" clearable v-model="deviceId" placeholder="è¯·éæ©"> |
| | | <el-option v-show="!hasPushed.includes(item.machineId)" v-for="item in deviceList" :key="item.machineId" :label="item.machineName" |
| | | :value="item.machineId"> |
| | | <el-option v-show="!hasPushed.includes(item.machineId)" v-for="item in deviceList" :key="item.machineId" |
| | | :label="item.machineName" :value="item.machineId"> |
| | | </el-option> |
| | | </el-select> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="mini" type="primary" style="background-color: #409EFF;" @click="saveDevice">ä¿å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog class="add-device" title="çæå°å¾" top="94px" :close-on-click-modal="false" width="400px" |
| | | :visible.sync="showMapSet" :show-close="false"> |
| | | <div> |
| | | <p> |
| | | <span>è¡æ°:</span> |
| | | <el-input style="width: 100px;" class="input" v-show="status !== 2" v-model="rows" /> |
| | | </p> |
| | | <p style="margin-top: 20px;"> |
| | | <span>åæ°:</span> |
| | | <el-input style="width: 100px;" class="input" v-show="status !== 2" v-model="cols" /> |
| | | </p> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="mini" type="primary" style="background-color: #409EFF;" @click="createMap">çæå°å¾</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | import mixins from '@/mixins/index' |
| | | import Device from '../workshop/device.vue' |
| | | import { mapGetters } from 'vuex' |
| | | import { getRequest, getUrl } from '@/api/Api' |
| | | export default { |
| | | mixins: [mixins], |
| | | components: { |
| | |
| | | Device |
| | | }, |
| | | props: { |
| | | status: { |
| | | type: Number, |
| | | default: 0 |
| | | }, |
| | | currentMap: { |
| | | default: [] |
| | | }, |
| | |
| | | if (!val) { |
| | | this.map = [] |
| | | } else { |
| | | // getRequest('machineList',{plantId: val}).then(res => { |
| | | // this.plantDeviceList = res.list.map(item => { |
| | | // return { |
| | | // machineId: item.id, |
| | | // machineName: item.machineName |
| | | // } |
| | | // }) || [] |
| | | // }) |
| | | getRequest('machineList',{plantId: val}).then(res => { |
| | | this.plantDeviceList = res.list.map(item => { |
| | | return { |
| | | machineId: item.id, |
| | | machineName: item.machineName |
| | | } |
| | | }) || [] |
| | | }) |
| | | } |
| | | }, |
| | | currentMap: { |
| | |
| | | }, |
| | | map() { |
| | | this.height = (document.querySelector('.table').getBoundingClientRect().height - 30) / 20 |
| | | } |
| | | }, |
| | | created () { |
| | | if (!this.id) { |
| | | this.showMapSet = true |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | back() { |
| | | this.$router.push({ |
| | | name: 'mapList' |
| | | }) |
| | | }, |
| | | addRow() { |
| | | this.rows +=1 |
| | | this.rows += 1 |
| | | let row = [] |
| | | for(var i=0;i<this.cols;i++) { |
| | | for (var i = 0; i < this.cols; i++) { |
| | | row.push({ |
| | | rowspan: 1, |
| | | colspan: 1, |
| | |
| | | }, |
| | | addCol() { |
| | | this.cols += 1 |
| | | for(var i=0;i<this.rows;i++) { |
| | | for (var i = 0; i < this.rows; i++) { |
| | | this.map[i].push( |
| | | { |
| | | rowspan: 1, |
| | | colspan: 1, |
| | | rowIndex: this.rows - 1, |
| | | colIndex: i, |
| | | rowIndex: i, |
| | | colIndex: this.cols - 1, |
| | | type: '' |
| | | } |
| | | ) |
| | |
| | | data.push(arr) |
| | | } |
| | | this.map = data |
| | | this.showMapSet = false |
| | | } |
| | | }, |
| | | contextmenu(e) { |
| | |
| | | |
| | | }, |
| | | onMousedown(e, v) { |
| | | console.log('-----',v) |
| | | console.log('-----', v) |
| | | if (e.button !== 0) return |
| | | this.tdMounseDown = true |
| | | this.showAction = false |
| | |
| | | e.stopPropagation() |
| | | this.addStatus = true |
| | | let hasPushed = [] |
| | | this.map.forEach(item => { |
| | | item.forEach(v => { |
| | | this.map.forEach(item => { |
| | | item.forEach(v => { |
| | | if (v.id) { |
| | | hasPushed.push(v.id) |
| | | } |
| | |
| | | message: 'æä½æå' |
| | | }) |
| | | this.$emit('out') |
| | | console.log(res) |
| | | }) |
| | | } else { |
| | | this.$http.postJson('/plant/modify', { |
| | |
| | | message: 'æä½æå' |
| | | }) |
| | | this.$emit('out') |
| | | console.log(res) |
| | | }) |
| | | } |
| | | |
| | |
| | | z-index: 999; |
| | | color: #fff; |
| | | width: 100px; |
| | | background: rgba(22,26,25,.8); |
| | | background: rgba(22, 26, 25, .8); |
| | | border: 2px solid #416071; |
| | | color: #ADAEAE; |
| | | text-align: center; |
| | | |
| | | div { |
| | | cursor: pointer; |
| | | padding: 8px 0; |
| | |
| | | overflow: hidden; |
| | | border-radius: 10px; |
| | | display: table; |
| | | |
| | | // box-sizing: border-box; |
| | | td { |
| | | // width: 50px; |
| | |
| | | border: 1px solid #1662DB; |
| | | vertical-align: middle; |
| | | text-align: center; |
| | | |
| | | .td-div { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | |
| | | &>img { |
| | | width: 20px; |
| | | height: 20px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | .machine { |
| | | width: 100%; |
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 22:26:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-31 21:07:07 |
| | | * @LastEditTime: 2024-02-02 23:37:37 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/index.vue |
| | | --> |
| | | <template> |
| | | <div class="workshop"> |
| | | <Map :id="id" :status="status" :currentMap="currentMap" @out="out" :name="plantName"> |
| | | <Nav :name="nav"> |
| | | <template> |
| | | <span class="back" @click="back"> |
| | | è¿å |
| | | </span> |
| | | </template> |
| | | </Nav> |
| | | <Map :id="id" :currentMap="currentMap" @out="out" :name="plantName"> |
| | | <template slot="tool"> |
| | | <div class="workshop-tool"> |
| | | <span v-show="id">车é´å°å¾:</span> |
| | | <el-select style="width: 150px" v-show="id" class="wkshoplist" v-model="id" placeholder="è¯·éæ©"> |
| | | <!-- <span v-show="id">车é´å°å¾:</span> --> |
| | | <!-- <el-select style="width: 150px" v-show="id" class="wkshoplist" v-model="id" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button size="mini" type="ghost" @click="id=''" v-show="id">æ°å¢</el-button> |
| | | </el-select> --> |
| | | <!-- <el-button size="mini" type="ghost" @click="id=''" v-show="id">æ°å¢</el-button> --> |
| | | </div> |
| | | </template> |
| | | </Map> |
| | |
| | | </template> |
| | | <script> |
| | | import Map from './Map.vue'; |
| | | import Nav from '@/components/nav' |
| | | import { getRequest, getUrl } from '@/api/Api' |
| | | import { mapGetters } from 'vuex' |
| | | export default { |
| | | components: { |
| | | Map, |
| | | Nav |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['workshopList']) |
| | | }, |
| | | watch: { |
| | | id(val) { |
| | | if (!val) { |
| | | this.currentMap = '' |
| | | this.plantName = '' |
| | | return |
| | | } |
| | | try { |
| | | this.currentMap = JSON.parse(this.mapList.find(item => item.id === this.id).gridSetting) |
| | | this.plantName = this.mapList.find(item => item.id === this.id).name |
| | | } catch (error) { |
| | | |
| | | } |
| | | // getRequest('machineList', { |
| | | // plantId: this.id, |
| | | // }).then(res => { |
| | | // // this.list = res.data.list |
| | | // this.info = { |
| | | // runRate: res.data.runRate, |
| | | // cutRate: res.data.cutRate, |
| | | // alarmRate: res.data.alarmRate, |
| | | // threeShiftRate: res.data.threeShiftRate, |
| | | // twoShiftRate: res.data.twoShiftRate, |
| | | // run: res.data.run, |
| | | // alarm: res.data.alarm, |
| | | // stop: res.data.stop, |
| | | // idle: res.data.idle |
| | | // } |
| | | // }) |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | nav: '', |
| | | id: '', |
| | | currentMap: [], |
| | | plantName: '', |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | back () { |
| | | this.$router.push({ |
| | | name: 'mapList' |
| | | }) |
| | | }, |
| | | getMapList() { |
| | | // this.$store.dispatch('GetPlanList', {}) |
| | | |
| | | this.$store.dispatch('GetPlanList', {}).then(res => { |
| | | try { |
| | | this.mapList = this.workshopList.filter(v => v.gridSetting && v.gridSetting != '{}') |
| | | if (this.mapList.length === 0) { |
| | | this.status = 0 |
| | | } |
| | | this.id = this.mapList[0].id |
| | | this.status = 1 |
| | | } catch (error) { |
| | | console.error(error) |
| | | } |
| | | }) |
| | | }, |
| | | addMap() { |
| | | this.status = 0 |
| | | this.id = '' |
| | | }, |
| | | out() { |
| | | this.getMapList() |
| | | this.back() |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getMapList() |
| | | created() { |
| | | if (this.$route.query.id) { |
| | | this.currentMap = JSON.parse(localStorage.getItem('map')) |
| | | this.plantName = this.$route.query.name |
| | | this.id = this.$route.query.id |
| | | this.nav = 'ç¼è¾å°å¾' |
| | | } else { |
| | | this.nav = 'æ°å¢å°å¾' |
| | | } |
| | | |
| | | // this.getMapList() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .back { |
| | | margin-left: auto; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <!-- |
| | | * @Date: 2024-01-06 17:40:19 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-29 23:07:39 |
| | | * @LastEditTime: 2024-02-02 22:12:14 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/list/index.vue |
| | | --> |
| | | <template> |
| | | <div class="list"> |
| | | <div class="search"> |
| | | <div class="search" v-show="!hideSearchBox"> |
| | | <slot name="search"></slot> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | props: { |
| | | url: { |
| | | type: String |
| | | }, |
| | | hideSearchBox: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data () { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-01-06 17:40:19 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-02-02 23:08:14 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapList/index.vue |
| | | --> |
| | | <template> |
| | | <div class="maintenance"> |
| | | <Nav name="车é´å°å¾"></Nav> |
| | | <List ref="list" url="/plant/pageQuery" :hideSearchBox="true"> |
| | | <template slot="table-tool"> |
| | | <el-button type="primary" size="mini" @click="add">æ°å¢å°å¾</el-button> |
| | | </template> |
| | | <template slot="columns"> |
| | | <el-table-column type="index" label="åºå·" align="center" width="55"> |
| | | </el-table-column> |
| | | <el-table-column label="åç§°" align="center" prop="name"> |
| | | </el-table-column> |
| | | <el-table-column label="è®¾å¤æ°é" align="center" prop="machineCount"> |
| | | </el-table-column> |
| | | <el-table-column width="" fixed="right" align="center" label="æä½"> |
| | | <template slot-scope="scope"> |
| | | <a class="table-action table-edit" @click="view(scope.row)">æ¥ç</a> |
| | | <a class="table-action table-edit" @click="edit(scope.row)">ç¼è¾</a> |
| | | <a class="table-action table-del" @click="del(scope.row)">å é¤</a> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </List> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { getUseDpts, getRequest } from '@/api/Api' |
| | | import List from '../list/index.vue' |
| | | import Nav from '@/components/nav' |
| | | export default { |
| | | components: { |
| | | Nav, |
| | | List, |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.query() |
| | | // this.init() |
| | | }, |
| | | methods: { |
| | | query () { |
| | | this.$refs.list.pageQuery({}) |
| | | }, |
| | | add () { |
| | | window.localStorage.removeItem('map') |
| | | this.$router.push({ |
| | | name: 'map', |
| | | }) |
| | | }, |
| | | view (row) { |
| | | window.localStorage.setItem('map', row.gridSetting) |
| | | this.$router.push({ |
| | | name: 'mapPreview', |
| | | query: { |
| | | id: row.id, |
| | | name: row.name |
| | | } |
| | | }) |
| | | }, |
| | | edit (row) { |
| | | window.localStorage.setItem('map', row.gridSetting) |
| | | this.$router.push({ |
| | | name: 'map', |
| | | query: { |
| | | id: row.id, |
| | | name: row.name |
| | | } |
| | | }) |
| | | }, |
| | | del(row) { |
| | | this.$confirm('ç¡®å®è¦æ°¸ä¹
å 餿¤å°å¾ï¼å
³èç设å¤å°éç½®?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(res => { |
| | | this.$http.postJson('/plant/delete', { |
| | | ids: [row.id] |
| | | }).then(res => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: 'å 餿å' |
| | | }) |
| | | this.$emit('out') |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: 'å é¤å¤±è´¥' |
| | | }) |
| | | }).finally(() => { |
| | | this.query() |
| | | }) |
| | | }, () => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: 'åæ¶å é¤' |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .maintenance { |
| | | .item-value { |
| | | .el-input__inner { |
| | | background: transparent; |
| | | border-radius: 2px; |
| | | border: 1px solid #435F9E; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="scss" scoped> |
| | | .maintenance { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | color: #FFF; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .nav { |
| | | padding: 10px 30px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .item { |
| | | margin-top: 20px; |
| | | margin-left: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | span { |
| | | width: 120px; |
| | | font-size: 16px; |
| | | font-family: PingFangSC, PingFang SC; |
| | | color: #C6DCE0; |
| | | text-align: right; |
| | | padding-right: 20px; |
| | | } |
| | | |
| | | .item-value { |
| | | width: 200px; |
| | | border: 1px solid #435F9E; |
| | | } |
| | | |
| | | .btn { |
| | | line-height: 1.5; |
| | | width: 100px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .reset { |
| | | background: #AAB6BA; |
| | | color: #FFF; |
| | | } |
| | | |
| | | .query { |
| | | background: #5DD1FC; |
| | | color: #FFF; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 23:47:53 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-30 20:41:19 |
| | | * @LastEditTime: 2024-02-03 00:01:58 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreview/Map.vue |
| | | --> |
| | | <template> |
| | |
| | | :width="v.colspan * height + 'px'" :height="v.rowspan * height + 'px'" v-for="v in item" |
| | | :rowspan="v.rowspan" :colspan="v.colspan" :key="v.rowIndex + '-' + v.colIndex"> |
| | | <div class="td-div" :style="{width:v.colspan * height - 2 + 'px',height: v.rowspan * height - 2 + 'px',overflow:'hidden'}"> |
| | | <Device v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" |
| | | <Device @toDetail="toDetail(v)" v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" |
| | | :deviceList="deviceList" :plantDeviceList="plantDeviceList"></Device> |
| | | </div> |
| | | </td> |
| | |
| | | } |
| | | import mixins from '@/mixins/index' |
| | | import Device from '../workshop/device.vue' |
| | | import { getRequest, getUrl } from '@/api/Api' |
| | | export default { |
| | | mixins: [mixins], |
| | | components: { |
| | |
| | | map: null, // å°å¾æ°æ® |
| | | leftMax: 0, |
| | | marginLeft: 0, |
| | | direction: true |
| | | direction: true, |
| | | plantDeviceList: [] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.height = (document.querySelector('.table').getBoundingClientRect().height - 30) / 20 |
| | | }, |
| | | id: { |
| | | handler() { |
| | | |
| | | handler(val) { |
| | | if (this.move) { |
| | | this.marginLeft = 0 |
| | | this.$nextTick(() => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if(val) { |
| | | getRequest('machineList',{plantId: val}).then(res => { |
| | | this.plantDeviceList = res.list.map(item => { |
| | | return { |
| | | machineId: item.id, |
| | | machineName: item.machineName |
| | | } |
| | | }) || [] |
| | | }) |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | toDetail(v) { |
| | | if(this.move) return |
| | | let info = {} |
| | | if (v.id) { |
| | | info = this.plantDeviceList.find(item => item.id == v.id) |
| | | } |
| | | window.localStorage.setItem('deviceInfo',JSON.stringify(info)) |
| | | this.$router.push({ |
| | | name: 'mapPreviewDetail', |
| | | query: { |
| | | id: v.id, |
| | | name: info.workshop |
| | | } |
| | | }) |
| | | }, |
| | | moveFn() { |
| | | if (this.marginLeft <= this.leftMax && this.marginLeft >= -5) { |
| | | if (this.direction) { |
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 22:26:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-31 21:41:12 |
| | | * @LastEditTime: 2024-02-02 22:56:40 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreview/index.vue |
| | | --> |
| | | <template> |
| | |
| | | </template> |
| | | <template slot="after"> |
| | | <div class="work-list"> |
| | | <span :title="item.name" :class="id===item.id ? 'active' : ''" v-for="item in mapList" @click="select(item)">{{item.name}}</span> |
| | | <!-- <span :title="item.name" :class="id===item.id ? 'active' : ''" v-for="item in mapList" @click="select(item)">{{item.name}}</span> --> |
| | | </div> |
| | | </template> |
| | | </Status> |
| | |
| | | select (v) { |
| | | this.id = v.id |
| | | }, |
| | | getMapList() { |
| | | this.$store.dispatch('GetPlanList', {}).then(res => { |
| | | try { |
| | | this.mapList = this.workshopList.filter(v => v.gridSetting && v.gridSetting != '{}') |
| | | if (this.mapList.length === 0) { |
| | | this.status = 0 |
| | | } |
| | | this.id = this.mapList[0].id |
| | | } catch (error) { |
| | | console.error(error) |
| | | } |
| | | }) |
| | | }, |
| | | // getMapList() { |
| | | // this.$store.dispatch('GetPlanList', {}).then(res => { |
| | | // try { |
| | | // this.mapList = this.workshopList.filter(v => v.gridSetting && v.gridSetting != '{}') |
| | | // if (this.mapList.length === 0) { |
| | | // this.status = 0 |
| | | // } |
| | | // this.id = this.mapList[0].id |
| | | // } catch (error) { |
| | | // console.error(error) |
| | | // } |
| | | // }) |
| | | // }, |
| | | }, |
| | | mounted() { |
| | | this.getMapList() |
| | | if (this.$route.query.id) { |
| | | this.currentMap = JSON.parse(localStorage.getItem('map')) |
| | | this.plantName = this.$route.query.name |
| | | this.id = this.$route.query.id |
| | | this.nav = 'ç¼è¾å°å¾' |
| | | } else { |
| | | this.nav = 'æ°å¢å°å¾' |
| | | } |
| | | // this.getMapList() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 22:26:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-31 21:54:36 |
| | | * @LastEditTime: 2024-02-02 23:46:50 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreviewDetail/index.vue |
| | | --> |
| | | <template> |
| | |
| | | this.$router.go(-1) |
| | | }, |
| | | init() { |
| | | |
| | | getFormRequest('getbyid', { |
| | | machineId: this.$route.query.id |
| | | }).then(res => { |
| | |
| | | <!-- |
| | | * @Date: 2024-01-05 22:26:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-31 21:47:40 |
| | | * @LastEditTime: 2024-02-02 23:32:35 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/preview/index.vue |
| | | --> |
| | | <template> |
| | |
| | | getMapList() { |
| | | try { |
| | | this.mapList = this.workshopList.filter (v => v.gridSetting && v.gridSetting!='{}') |
| | | if (this.mapList.length === 0) { |
| | | this.status = 2 |
| | | } |
| | | this.id =this.mapList[0].id |
| | | } catch (error) { |
| | | console.error(error) |
| | |
| | | }, |
| | | }, |
| | | mounted () { |
| | | this.getMapList() |
| | | this.$store.dispatch('GetPlanList', {}).then(res => { |
| | | this.getMapList() |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | component: () => import('@/container/home/Welcome')
|
| | | },
|
| | | {
|
| | | path: 'mapList',
|
| | | name: 'mapList',
|
| | | component: () => import('@/container/mapList/index')
|
| | | },
|
| | | {
|
| | | path: 'map',
|
| | | name: 'map',
|
| | | component: () => import('@/container/Map/index')
|
| | |
| | | /*
|
| | | * @Date: 2022-11-09 12:37:25
|
| | | * @LastEditors: Sneed
|
| | | * @LastEditTime: 2024-01-17 23:20:35
|
| | | * @LastEditTime: 2024-02-02 22:01:56
|
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/utils/ajax.js
|
| | | */
|
| | | import axios from 'axios'
|
| | |
| | | Message({
|
| | | message: response.data.msg,
|
| | | type: 'error',
|
| | | duration: 3 * 1000
|
| | | duration: 600
|
| | | })
|
| | | return Promise.reject('error')
|
| | | }
|
| | |
| | | Message({
|
| | | message: 'æå¡è¿æ¥å¼å¸¸ï¼è¯·ç¨åéè¯æè系管çå',
|
| | | type: 'error',
|
| | | duration: 5 * 1000
|
| | | duration: 600
|
| | | })
|
| | | return Promise.reject(error)
|
| | | }
|