gaosp
2024-01-31 6db7de7f92352106774f7cdcf6c5cf2ac6257b7f
修改一些问题
已修改10个文件
178 ■■■■ 文件已修改
src/components/nav.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/Map/Map.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/Map/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/maintenance/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/mapPreview/Map.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/mapPreview/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/mapPreviewDetail/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/preview/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/workshop/device.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/workshop/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/nav.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-21 15:41:42
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 23:00:21
 * @LastEditTime: 2024-01-30 00:07:25
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/components/nav.vue
-->
<template>
@@ -21,7 +21,7 @@
    .nav {
        display: flex;
        align-items: center;
        padding: 0 20px;
        padding: 4px 20px;
        span {
            font-size: 14px;
            font-family: PingFangSC, PingFang SC;
src/container/Map/Map.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 23:47:53
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 22:46:03
 * @LastEditTime: 2024-01-31 21:10:02
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/Map.vue
-->
<template>
@@ -9,22 +9,24 @@
        <div class="map-container">
            <div class="table-tool">
                <slot name="tool"></slot>
                <el-button v-show="!id" class="input" type="primary" size="mini" @click="out">退出</el-button>
                <el-button class="input" type="primary" size="mini" @click="save">保存</el-button>
                <el-button v-show="id" class="input" type="primary" size="mini" @click="del">删除</el-button>
                <el-button class="input" size="mini" type="primary" v-show="status !== 2" @click="createMap">生成地图</el-button>
                <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" />
                <!-- <div class="plant-name" v-if="status===2">{{plantName}}</div> -->
                <span>名称:</span>
                <el-input style="width: 70px;" class="input"  v-model="plantName" placeholder="请输入厂名" />
                <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>
            </div>
            <div class="table" :class="$route.name === 'preview' ? 'active' : ''">
                <div class="table-actions" :style="position" v-show="showAction && status !== 2">
                    <div @click="merge">合并</div>
                    <div @click="split">拆分</div>
                    <div @click="addRow">增加行</div>
                    <div @click="addCol">增加列</div>
                    <div @click="sign(1)">过道</div>
                    <div @click="sign(2)">设备</div>
                    <div @click="sign(0)">移除</div>
@@ -32,22 +34,26 @@
                <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">
                                <img @click="addDevice($event, v)" @mousedown="e => e.stopPropagation()"
                                <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>
                                    <Device v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" :deviceList="deviceList"
                                        :plantDeviceList="plantDeviceList" ::info="info"></Device>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <el-dialog title="放置设备" top="94px" :close-on-click-modal="false" width="100%" :visible.sync="addStatus" >
        <el-dialog class="add-device" title="放置设备" top="94px" :close-on-click-modal="false" width="400px" :visible.sync="addStatus" >
            <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">
@@ -243,6 +249,37 @@
        }
    },
    methods: {
        addRow() {
            this.rows +=1
            let row = []
            for(var i=0;i<this.cols;i++) {
                row.push({
                    rowspan: 1,
                    colspan: 1,
                    rowIndex: this.rows - 1,
                    colIndex: i,
                    type: ''
                })
            }
            this.map.push(row)
            this.showAction = false
            this.$forceUpdate()
        },
        addCol() {
            this.cols += 1
            for(var i=0;i<this.rows;i++) {
                this.map[i].push(
                    {
                        rowspan: 1,
                        colspan: 1,
                        rowIndex: this.rows - 1,
                        colIndex: i,
                        type: ''
                    }
                )
            }
            this.showAction = false
        },
        async createMap() {
            let res = true
            if (this.id) {
@@ -295,7 +332,7 @@
        },
        onMousedown(e, v) {
            if (this.status === 2) return
            console.log('-----',v)
            if (e.button !== 0) return
            this.tdMounseDown = true
            this.showAction = false
@@ -470,6 +507,11 @@
    },
}
</script>
<style lang="scss">
#app .add-device .el-dialog {
    height: 300px;
}
</style>
<style lang="scss" scoped>
@keyframes move {
    0% {
@@ -566,11 +608,11 @@
    table {
        width: 100%;
        border-collapse: collapse;
        // table-layout: fixed;
        // word-wrap: break-word;
        table-layout: fixed;
        word-wrap: break-word;
        overflow: hidden;
        border-radius: 10px;
        display: table;
        // box-sizing: border-box;
        td {
            // width: 50px;
@@ -579,12 +621,17 @@
            border: 1px solid #1662DB;
            vertical-align: middle;
            text-align: center;
            &>img {
                width: 20px;
                height: 20px;
                cursor: pointer;
            .td-div {
                display: flex;
                align-items: center;
                justify-content: center;
                &>img {
                    width: 20px;
                    height: 20px;
                    cursor: pointer;
                }
            }
            .machine {
                width: 100%;
src/container/Map/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 22:26:22
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-20 19:41:22
 * @LastEditTime: 2024-01-31 21:07:07
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/index.vue
-->
<template>
@@ -10,10 +10,11 @@
            <template slot="tool">
                <div class="workshop-tool">
                    <span v-show="id">车间地图:</span>
                    <el-select style="width: 100px" v-show="id" class="wkshoplist" clearable v-model="id" placeholder="请选择">
                    <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>
                </div>
            </template>
        </Map>
src/container/maintenance/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 23:06:50
 * @LastEditTime: 2024-01-30 21:05:16
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/maintenance/index.vue
-->
<template>
@@ -71,12 +71,15 @@
                </el-table-column>
                <el-table-column align="center" label="设备规格" prop="specification">
                </el-table-column>
                <el-table-column align="center" label="使用单位" prop="department">
                <el-table-column align="center" label="使用部门" prop="department">
                    <template slot-scope="scope">
                        <span>{{ departmentlist.find(item =>item.value == scope.row.department).label  }}</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" label="保养者" prop="userName">
                </el-table-column>
                <el-table-column align="center" label="保养周期" prop="period">
                </el-table-column>
                <!-- <el-table-column align="center" label="保养周期" prop="period">
                </el-table-column> -->
                <el-table-column align="center" label="保养类型" prop="style">
                    <template slot-scope="scope">
                        <span>{{ scope.row.style === "1" ? "日常保养" : scope.row.style === "2" ? "一级保养" :
src/container/mapPreview/Map.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 23:47:53
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 22:29:51
 * @LastEditTime: 2024-01-30 20:41:19
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreview/Map.vue
-->
<template>
@@ -15,8 +15,10 @@
                            <td v-if="v.rowspan !== 0 && v.colspan !== 0" :class="{ aisle: v.type === 1 }"
                                :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">
                                <Device v-if="v.id" :id="v.id" style="width: 100%;height: 100%;"
                                    :deviceList="deviceList" :plantDeviceList="plantDeviceList"></Device>
                                <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%;"
                                        :deviceList="deviceList" :plantDeviceList="plantDeviceList"></Device>
                                </div>
                            </td>
                        </tr>
                    </table>
@@ -270,12 +272,17 @@
            border: 1px solid #1662DB;
            vertical-align: middle;
            text-align: center;
            &>img {
                width: 20px;
                height: 20px;
                cursor: pointer;
            .td-div {
                display: flex;
                align-items: center;
                justify-content: center;
                &>img {
                    width: 20px;
                    height: 20px;
                    cursor: pointer;
                }
            }
            .machine {
                width: 100%;
src/container/mapPreview/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 22:26:22
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-21 22:58:11
 * @LastEditTime: 2024-01-31 21:41:12
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreview/index.vue
-->
<template>
@@ -23,7 +23,7 @@
                    </template>
                    <template slot="after">
                        <div class="work-list">
                            <span :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>
@@ -139,7 +139,11 @@
    margin-left: auto;
    margin-right: 20px;
    span {
        width: 68px;
        //width: 68px;
        padding: 0 10px;
        max-width: 100px;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: center;
        line-height: 28px;
        background: rgba(23,38,67,0.6);
src/container/mapPreviewDetail/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 22:26:22
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 23:51:52
 * @LastEditTime: 2024-01-30 00:05:47
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreviewDetail/index.vue
-->
<template>
@@ -65,7 +65,7 @@
                    </div>
                </div>
                <div class="center-bottom">
                    <img src="./img/jq.png" alt="">
                    <img :src="deviceInfo.pic || png" alt="">
                </div>
            </div>
            <div class="right">
@@ -117,7 +117,7 @@
                        <span class="img-status standby" v-if="deviceInfo.status === 'IDLE'">待机</span>
                        <span class="img-status alerm" v-if="deviceInfo.status === 'ALARM'">报警</span>
                    </p>
                    <!-- <p>待机原因: {{}}</p> -->
                    <p>待机原因: {{status.yy}}</p>
                </div>
                <div class="right_2">
                    <p>加工数据</p>
@@ -164,6 +164,7 @@
</template>
<script>
import Nav from '@/components/nav'
import png from './img/jq.png'
import { getRequest, getFormRequest } from '@/api/Api'
export default {
    components: {
@@ -171,6 +172,7 @@
    },
    data() {
        return {
            png,
            cycleTime: '',
            name: '',
            deviceInfo: {
@@ -455,7 +457,7 @@
                        left: 50%;
                        top: 50%;
                        transform: translate(-50%, -50%);
                        font-size: 46px;
                        font-size: 26px;
                        font-weight: bold;
                        color: #C3E1E1;
                    }
src/container/preview/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-05 22:26:22
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-20 20:39:26
 * @LastEditTime: 2024-01-31 21:47:40
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/preview/index.vue
-->
<template>
@@ -27,7 +27,7 @@
                    </template>
                    <template slot="after">
                        <div class="work-list">
                            <span :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>
@@ -141,7 +141,11 @@
    margin-left: auto;
    margin-right: 20px;
    span {
        width: 68px;
        //width: 68px;
        max-width: 100px;
        white-space: nowrap;
        text-overflow: ellipsis;
        padding: 0 10px;
        text-align: center;
        line-height: 28px;
        background: rgba(23,38,67,0.6);
src/container/workshop/device.vue
@@ -1,14 +1,14 @@
<!--
 * @Date: 2024-01-13 20:46:33
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 22:28:36
 * @LastEditTime: 2024-01-31 21:31:13
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue
-->
<template>
    <div class="device-item">
        <el-checkbox v-show="canconcern" class="care" v-model="concern" @change="change"></el-checkbox>
        <p>{{ machineName }}</p>
        <div class="device-item-box">
        <div class="device-item-box" @click="toDetail">
            <div class="img">
                <span class="img-status" v-if="item.status === 'STOP'">停机</span>
                <span class="img-status run" v-if="item.status === 'RUN'">运行</span>
@@ -137,6 +137,9 @@
        }
    },
    methods: {
        toDetail () {
            this.$emit('toDetail')
        },
        change(val) {
            console.log(val)
            getRequest('machineConcern', { concern: val ? 1 : 0, id: this.id }).then(res => {
@@ -159,7 +162,10 @@
    display: flex;
    flex-direction: column;
    position: relative;
    p {
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .care {
        position: absolute;
        right: 5px;
src/container/workshop/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-29 23:07:00
 * @LastEditTime: 2024-01-31 21:30:42
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/index.vue
-->
<template>
@@ -29,7 +29,7 @@
                </Status>
                <div class="list-box">
                    <div class="list">
                        <Item @click.native="toDetail(item)" canconcern v-for="item in listFilter" :id="item.id" :info="item" :key="item.id"></Item>
                        <Item @toDetail="toDetail(item)" canconcern v-for="item in listFilter" :id="item.id" :info="item" :key="item.id"></Item>
                    </div>
                </div>
            </div>