| | |
| | | <!-- |
| | | * @Date: 2024-01-05 22:26:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-06 19:00:32 |
| | | * @LastEditTime: 2024-01-06 23:10:19 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/index.vue |
| | | --> |
| | | <template> |
| | |
| | | <Map v-if="status===0 || status === 1" :status="status" :currentMap="currentMap" :name="plantName" :id="id" @out="out" /> |
| | | <div v-else class="preview"> |
| | | <div class="left"> |
| | | <div v-if="id" @click="editMap" class="edit-btn"> |
| | | <div @click="editMap" class="edit-btn"> |
| | | 进入编辑状态 |
| | | </div> |
| | | <el-select size="mini" class="left-select" v-model="id" placeholder="请选择"> |
| | | <el-select clearable class="left-select" v-model="id" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in mapList" |
| | | :key="item.id" |
| | |
| | | Map |
| | | }, |
| | | watch: { |
| | | id () { |
| | | id (val) { |
| | | if (!val) { |
| | | this.currentMap = '' |
| | | this.plantName = '' |
| | | return |
| | | } |
| | | this.currentMap = JSON.parse(this.mapList.find(item => item.id ===this.id).gridSetting) |
| | | this.plantName = this.mapList.find(item => item.id ===this.id).name |
| | | } |
| | |
| | | }) |
| | | }, |
| | | editMap () { |
| | | console.log('--------') |
| | | this.status = 1 |
| | | if (this.id) { |
| | | this.status = 1 |
| | | } else { |
| | | this.status = 0 |
| | | } |
| | | }, |
| | | out () { |
| | | this.status = 2 |
| | | this.getMapList() |
| | | } |
| | | }, |
| | | mounted () { |
| | |
| | | background: url('./img//btn.png') 100% center no-repeat; |
| | | background-size: contain; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | } |
| | | .left-select { |
| | | margin-top: 20px; |