|
@@ -1,642 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="square-container" @click="onClickOutside">
|
|
|
- <div class="square-left">
|
|
|
- <SearchBar
|
|
|
- class="search-container"
|
|
|
- v-model="inputValue"
|
|
|
- @focus="onFocus"
|
|
|
- @input="onInput"
|
|
|
- ref="searchbar"
|
|
|
- />
|
|
|
- <div class="square-map">
|
|
|
- <el-row>
|
|
|
- <el-col v-for="(item, index) in images" :key="item" :span="8">
|
|
|
- <div
|
|
|
- class="grid-item-background"
|
|
|
- style="
|
|
|
- background-color: black;
|
|
|
- padding-top: 30px;
|
|
|
- padding-bottom: 30px;
|
|
|
- padding-left: 5px;
|
|
|
- padding-right: 5px;
|
|
|
- margin: 10px;
|
|
|
- border-radius: 20px;
|
|
|
- "
|
|
|
- >
|
|
|
- <div class="grid-item">
|
|
|
- <img
|
|
|
- :src="item.url"
|
|
|
- @dblclick="handleDblClickImg(item.alt)"
|
|
|
- @click="handleClickImg(item.alt, index)"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="grid-item-close">
|
|
|
- <img
|
|
|
- width="30px"
|
|
|
- src="../../images/closeremotebench.png"
|
|
|
- @click="handleCloseImg(item.alt)"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="square-right">
|
|
|
- <!-- <div class="square-count backgroundBox" v-show="!currentBench.selected">
|
|
|
- <status-bar
|
|
|
- :ready="readyCount"
|
|
|
- :occupied="occupiedCount"
|
|
|
- :offline="offlineCount"
|
|
|
- ></status-bar>
|
|
|
- </div> -->
|
|
|
- <!-- <div
|
|
|
- class="origin-basic"
|
|
|
- v-show="currentBench.selected"
|
|
|
- @dblclick="handleInfoDblClick(currentBench.benchId)"
|
|
|
- >
|
|
|
- <div>
|
|
|
- <span>Location:</span>
|
|
|
- <span>Automation Lab-7E</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>MU_SW</span>
|
|
|
- <span>{{ currentBench.MU_SW }}</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>Cluster</span>
|
|
|
- <span>{{ currentBench.Cluster }}</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>Market</span>
|
|
|
- <span>{{ currentBench.Market }}</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>Box IP</span>
|
|
|
- <span>{{ currentBench.ip }}</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>Box Version</span>
|
|
|
- <span>{{ currentBench.equipment?.version }}</span>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
- <div class="square-list">
|
|
|
- <TabList
|
|
|
- :tabs="tabs"
|
|
|
- :itemRender="itemRender"
|
|
|
- :tabClass="tabClass"
|
|
|
- :readyCount="readyCount"
|
|
|
- :occupiedCount="occupiedCount"
|
|
|
- :offlineCount="offlineCount"
|
|
|
- ></TabList>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
-import "./index.less";
|
|
|
-import StatusBar from "../../components/StatusBar";
|
|
|
-import TabList from "../../components/TabList";
|
|
|
-import SearchBar from "../../components/SearchBar";
|
|
|
-import { mapState } from "vuex";
|
|
|
-import webSocket from "../../service/ws";
|
|
|
-import bus from "../../service/bus";
|
|
|
-
|
|
|
-const ws = new webSocket();
|
|
|
-let wsArray = [];
|
|
|
-let wsArrayLength = 0;
|
|
|
-for (var iR = 0; iR < 20; iR++) {
|
|
|
- const wsRemote = new webSocket();
|
|
|
-
|
|
|
- wsRemote.open().then((res) => {
|
|
|
- // console.log("res", res);
|
|
|
- });
|
|
|
- wsArray.push(wsRemote);
|
|
|
-}
|
|
|
-
|
|
|
-export default {
|
|
|
- components: { StatusBar, TabList, SearchBar },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- currentBenchId: 0,
|
|
|
- currentBench: {},
|
|
|
- inputValue: "",
|
|
|
- isOpen: false,
|
|
|
- gridItems: [1, 2, 3, 4, 5, 6, 7, 8, 9],
|
|
|
- readyCount: 10,
|
|
|
- occupiedCount: 5,
|
|
|
- offlineCount: 3,
|
|
|
- previousSelectedBenchList: [],
|
|
|
- selectedBenchList: [],
|
|
|
- tabs: [
|
|
|
- {
|
|
|
- title: "Bench",
|
|
|
- list: [
|
|
|
- {
|
|
|
- title: "Item 1",
|
|
|
- description: "1111111",
|
|
|
- image: "item1.jpg",
|
|
|
- tag: "Tag 1",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 2",
|
|
|
- description: "32222",
|
|
|
- image: "item2.jpg",
|
|
|
- tag: "Tag 2",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 3",
|
|
|
- description: "1111111",
|
|
|
- image: "item3.jpg",
|
|
|
- tag: "Tag 3",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Task",
|
|
|
- list: [
|
|
|
- {
|
|
|
- title: "Item 4",
|
|
|
- description: "1111111",
|
|
|
- image: "item4.jpg",
|
|
|
- tag: "Tag 4",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 5",
|
|
|
- description: "1111111",
|
|
|
- image: "item5.jpg",
|
|
|
- tag: "Tag 5",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 6",
|
|
|
- description: "1111111",
|
|
|
- image: "item6.jpg",
|
|
|
- tag: "Tag 6",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Issue",
|
|
|
- list: [
|
|
|
- {
|
|
|
- title: "Item 7",
|
|
|
- image: "item7.jpg",
|
|
|
- tag: "Tag 7",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 8",
|
|
|
- image: "item8.jpg",
|
|
|
- tag: "Tag 8",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Item 9",
|
|
|
- image: "item9.jpg",
|
|
|
- tag: "Tag 9",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- tabClass() {
|
|
|
- return "square";
|
|
|
- },
|
|
|
- ...mapState({
|
|
|
- images: (state) => state.benchList.benchImgList,
|
|
|
- }),
|
|
|
- ...mapState({
|
|
|
- benchList: (state) => {
|
|
|
- return state.benchList.benchList;
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
- created() {
|
|
|
- ws.open().then((res) => {
|
|
|
- // console.log("res", res);
|
|
|
- });
|
|
|
- window.handleListClick = this.handleListClick;
|
|
|
- window.handleListDbClick = this.handleListDbClick;
|
|
|
- window.handleDblClickImg = this.handleDblClickImg;
|
|
|
- window.handleClickImg = this.handleClickImg;
|
|
|
- window.selectBench = this.selectBench.bind(this);
|
|
|
- let that = this;
|
|
|
- that.$store.dispatch("benchList/fetchBenchList");
|
|
|
- },
|
|
|
- async mounted() {
|
|
|
- this.tabs[0].list = this.benchList;
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- var readyCount = 0;
|
|
|
- var occupiedCount = 0;
|
|
|
- var offlineCount = 0;
|
|
|
- console.log("this.benchList", this.benchList.length);
|
|
|
- this.benchList.forEach((element) => {
|
|
|
- //console.log('element',element);
|
|
|
- if (element.status == "ready") {
|
|
|
- readyCount++;
|
|
|
- } else if (element.status == "error") {
|
|
|
- offlineCount++;
|
|
|
- } else if (element.status == "offline") {
|
|
|
- offlineCount++;
|
|
|
- } else {
|
|
|
- occupiedCount++;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- this.readyCount = readyCount;
|
|
|
- this.offlineCount = offlineCount;
|
|
|
- this.occupiedCount = occupiedCount;
|
|
|
- let self = this;
|
|
|
-
|
|
|
- var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
|
|
|
- var objRBL = JSON.parse(strRemoteBenchList);
|
|
|
- if (objRBL) {
|
|
|
- console.log("objRBL", objRBL);
|
|
|
- wsArrayLength = objRBL.length;
|
|
|
- for (var iW = 0; iW < objRBL.length; iW++) {
|
|
|
- var i = JSON.parse(JSON.stringify(iW));
|
|
|
- let benchId = JSON.parse(JSON.stringify(objRBL[i]));
|
|
|
- setTimeout(() => {
|
|
|
- console.log("connect bench", benchId);
|
|
|
- wsArray[i]
|
|
|
- .connectBench({ bench_id: String(benchId) })
|
|
|
- .then((res) => {
|
|
|
- console.log("connect bench success", benchId);
|
|
|
- self.getBenchImage(benchId, 1, wsArray[i], () => {});
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log("connect bench failed", benchId);
|
|
|
- this.$message({
|
|
|
- message: "This bench is offline",
|
|
|
- // message: "",
|
|
|
- type: "warning",
|
|
|
- });
|
|
|
- });
|
|
|
- }, iW * 2000);
|
|
|
- }
|
|
|
- }
|
|
|
- }, 3000);
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //itemRender(item) {
|
|
|
- //return `
|
|
|
- // <div class="item-box">
|
|
|
- // <div class="item-title">${item.title}</div>
|
|
|
- // <div class="item-tag">
|
|
|
- // <div class="tag">3b</div>
|
|
|
- // <div class="tag">CN</div>
|
|
|
- // </div>
|
|
|
- //</div>`;
|
|
|
- //},
|
|
|
-
|
|
|
- sleep(delay) {
|
|
|
- var start = new Date().getTime();
|
|
|
- while (new Date().getTime() - start < delay) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- },
|
|
|
- saveSelectedBenchToLs(benchId) {
|
|
|
- var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
|
|
|
- var objRBL = JSON.parse(strRemoteBenchList);
|
|
|
- if (objRBL && objRBL.length > 0) {
|
|
|
- var bExist = false;
|
|
|
- for (var i = 0; i < objRBL.length; i++) {
|
|
|
- if (objRBL[i] == benchId) {
|
|
|
- bExist = true;
|
|
|
- } else {
|
|
|
- }
|
|
|
- }
|
|
|
- if (bExist == false) {
|
|
|
- objRBL.push(benchId);
|
|
|
- window.localStorage.setItem(
|
|
|
- "remoteBenchList",
|
|
|
- JSON.stringify(objRBL)
|
|
|
- );
|
|
|
- }
|
|
|
- } else {
|
|
|
- var rml = [];
|
|
|
- rml.push(benchId);
|
|
|
- window.localStorage.setItem("remoteBenchList", JSON.stringify(rml));
|
|
|
- }
|
|
|
- },
|
|
|
- selectBench(benchId) {
|
|
|
- this.saveSelectedBenchToLs(benchId);
|
|
|
-
|
|
|
- var i = JSON.parse(JSON.stringify(wsArrayLength));
|
|
|
- let self = this;
|
|
|
- wsArrayLength++;
|
|
|
- setTimeout(() => {
|
|
|
- console.log("connect bench", benchId);
|
|
|
- wsArray[i]
|
|
|
- .connectBench({ bench_id: String(benchId) })
|
|
|
- .then((res) => {
|
|
|
- console.log("connect bench success", benchId);
|
|
|
- self.getBenchImage(benchId, 1, wsArray[i], () => {});
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log("connect bench failed", benchId);
|
|
|
- this.$message({
|
|
|
- message: "This bench is offline",
|
|
|
- // message: "",
|
|
|
- type: "warning",
|
|
|
- });
|
|
|
- });
|
|
|
- }, 200);
|
|
|
- //let self = this;
|
|
|
- //let bench = this.benchList.find(b => b.id == benchId);
|
|
|
- //if (this.previousSelectedBenchList.length) {
|
|
|
- // this.selectedBenchList = JSON.parse(
|
|
|
- // JSON.stringify(this.previousSelectedBenchList)
|
|
|
- // );
|
|
|
- //}
|
|
|
- //this.previousSelectedBenchList = [];
|
|
|
- //this.platform = null;
|
|
|
- //this.benchList.forEach(b => b.selected = false)
|
|
|
- //bench.selected = !bench.selected;
|
|
|
- //if (bench.selected) {
|
|
|
- // this.currentBench = bench;
|
|
|
- // this.selectedBenchList.push(bench);
|
|
|
- // // this.images = this.selectedBenchList.map((s) => {
|
|
|
- // // return {
|
|
|
- // // url: "",
|
|
|
- // // alt: s.name,
|
|
|
- // // };
|
|
|
- // // });
|
|
|
- //} else {
|
|
|
- // for (let i in this.selectedBenchList) {
|
|
|
- // if (this.selectedBenchList[i].id == bench.id) {
|
|
|
- // this.selectedBenchList.splice(i, 1);
|
|
|
- // // this.images = this.selectedBenchList.map((s) => {
|
|
|
- // // return {
|
|
|
- // // url: "",
|
|
|
- // // alt: s.name,
|
|
|
- // // };
|
|
|
- // // });
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //if (this.selectedBenchList.length == 0) {
|
|
|
- // nextTick(() => {
|
|
|
- // self.initBmInfoNsChart();
|
|
|
- // });
|
|
|
- //} else {
|
|
|
- // self.bmMapItemActivate();
|
|
|
- //}
|
|
|
- },
|
|
|
- itemRender(item) {
|
|
|
- if (item.benchType == 2) {
|
|
|
- item.image = require("../../assets/mechine2.png");
|
|
|
- } else {
|
|
|
- item.image = require("../../assets/mechine.png");
|
|
|
- }
|
|
|
- return `
|
|
|
- <div onDblClick="handleListDbClick(${item.id},${item.itemtype})" onClick="handleListClick(${item.id},${item.itemtype})" class="item-box">
|
|
|
- <div class="item-image"><img src="${item.image}" alt="${item.title}"></div>
|
|
|
- <div class="item-right">
|
|
|
- <div class="item-text">
|
|
|
- <div class="item-title">${item.id}
|
|
|
- <span onClick="selectBench(${item.id})" class="el-icon-s-platform ${item.status}"></span>
|
|
|
- </div>
|
|
|
- <div class="item-description">Automation Lab-7E</div>
|
|
|
- <div class="item-description">${item.name}</div>
|
|
|
- <div class="item-tag">
|
|
|
- <div class="tag">${item.Market}</div>
|
|
|
- <div class="tag">${item.Platform}</div>
|
|
|
- <div class="tag">${item.Project}</div>
|
|
|
- <div class="tag">${item.Carline}</div>
|
|
|
- <div class="tag">${item.Cluster}</div>
|
|
|
- </div>
|
|
|
- <div class="item-tag">
|
|
|
- <div class="tag">${item.MU_SW}</div>
|
|
|
- <div class="tag">${item.Variant}</div>
|
|
|
- <div class="tag">${item.ip}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>`;
|
|
|
- },
|
|
|
- rowClassName() {
|
|
|
- return "row-class";
|
|
|
- },
|
|
|
- onFocus() {
|
|
|
- this.isOpen = true;
|
|
|
- },
|
|
|
- onInput(value) {
|
|
|
- this.inputValue = value;
|
|
|
- },
|
|
|
- onClickOutside() {},
|
|
|
- handleListClick(benchId, itemtype) {
|
|
|
- if (itemtype == 2) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$nextTick(() => {
|
|
|
- if (benchId == this.currentBench.benchId) {
|
|
|
- benchId = 0;
|
|
|
- let items = document.getElementsByClassName("grid-item-background");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#000000";
|
|
|
- }
|
|
|
- this.currentBench = {};
|
|
|
- return;
|
|
|
- }
|
|
|
- let items = document.getElementsByClassName("grid-item-background");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#000000";
|
|
|
- if (this.images[index].alt == benchId) {
|
|
|
- console.log("equal");
|
|
|
- items[index].style.background = "#ffffff";
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- //this.currentBench = this.benchList.find(b => b.id == benchId);
|
|
|
- //this.isDetailVisible = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- //this.$refs.benchdetail.init(benchId);
|
|
|
- //this.benchList.forEach(element =>
|
|
|
- //{
|
|
|
- // element.style = "{background: rgba(0, 0, 0, 1)}"
|
|
|
- //});
|
|
|
- if (
|
|
|
- benchId == this.currentBench.id &&
|
|
|
- this.currentBench.selected == true
|
|
|
- ) {
|
|
|
- this.currentBench.selected = false;
|
|
|
- this.currentBench = {};
|
|
|
- let items = document.getElementsByClassName("item-box");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#00000032";
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- let items = document.getElementsByClassName("item-box");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#00000032";
|
|
|
- let title = items[index].getElementsByClassName("item-title");
|
|
|
- console.log("textContent", title[0].textContent);
|
|
|
- let itemOther = this.benchList.find(
|
|
|
- (b) => parseInt(b.id) == parseInt(title[0].textContent)
|
|
|
- );
|
|
|
- itemOther.selected = false;
|
|
|
- if (parseInt(benchId) == parseInt(title[0].textContent)) {
|
|
|
- items[index].style.background = "#000000C0";
|
|
|
- this.currentBench = this.benchList.find((b) => b.id == benchId);
|
|
|
- this.currentBench.selected = true;
|
|
|
- }
|
|
|
- }
|
|
|
- // console.log('this.currentBench', this.currentBench);
|
|
|
- bus.emit("benchInfoVisible", this.currentBench);
|
|
|
- });
|
|
|
- },
|
|
|
- handleListDbClick(benchId, itemtype) {
|
|
|
- if (itemtype == 2) {
|
|
|
- window.location.href = "/task2?m=8b934420_ZJUb_b6f9";
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- //this.currentBench = this.benchList.find(b => b.id == benchId);
|
|
|
- //this.isDetailVisible = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- //this.$refs.benchdetail.init(benchId);
|
|
|
- //this.benchList.forEach(element =>
|
|
|
- //{
|
|
|
- // element.style = "{background: rgba(0, 0, 0, 1)}"
|
|
|
- //});
|
|
|
- this.currentBench = this.benchList.find((b) => b.id == benchId);
|
|
|
- //this.currentBench.style = "{background: rgba(0, 0, 0, 1)}"
|
|
|
- console.log("current bench", this.currentBench);
|
|
|
- this.isRemoteBtnVisible = true;
|
|
|
- this.isDetailVisible = true;
|
|
|
- });
|
|
|
- },
|
|
|
- getBenchImage(benchId, screenType, wsRemote, func) {
|
|
|
- let self = this;
|
|
|
- setTimeout(() => {
|
|
|
- wsRemote.getImage(String(benchId), screenType).then((res) => {
|
|
|
- console.log("getImageRes", res);
|
|
|
- // let screen = screenType == 1 ? "upper" : "lower";
|
|
|
- if (screenType == 1) {
|
|
|
- //self.benchImgUpper = "data:image/png;base64," + res.data.data;
|
|
|
- } else {
|
|
|
- //self.benchImgLower = "data:image/png;base64," + res.data.data;
|
|
|
- }
|
|
|
- // let screen = res.data.screen_type;
|
|
|
- //self.getBenchImage(benchId, screenType, wsRemote, func);
|
|
|
- this.$store.dispatch("benchList/setBenchImgList", {
|
|
|
- benchId,
|
|
|
- img: res.data.data,
|
|
|
- });
|
|
|
- });
|
|
|
- }, 500);
|
|
|
- },
|
|
|
- handleDblClickImg(benchId) {
|
|
|
- window.location.href =
|
|
|
- "/originPage?m=8b934420_ZJUb_b6f9&benchid=" + benchId;
|
|
|
- },
|
|
|
- handleClickImg(benchId, indexParam) {
|
|
|
- this.$nextTick(() => {
|
|
|
- if (benchId == this.currentBenchId) {
|
|
|
- benchId = 0;
|
|
|
- let items = document.getElementsByClassName("grid-item-background");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#000000";
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- this.currentBenchId = benchId;
|
|
|
- let items = document.getElementsByClassName("grid-item-background");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#000000";
|
|
|
- if (index == indexParam) {
|
|
|
- console.log("equal");
|
|
|
- items[index].style.background = "#ffffff";
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- this.$nextTick(() => {
|
|
|
- if (
|
|
|
- benchId == this.currentBench.id &&
|
|
|
- this.currentBench.selected == true
|
|
|
- ) {
|
|
|
- this.currentBench.selected = false;
|
|
|
- this.currentBench.scale = 1;
|
|
|
- this.currentBench = {};
|
|
|
- let items = document.getElementsByClassName("item-box");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#00000032";
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- let items = document.getElementsByClassName("item-box");
|
|
|
- for (var index = 0; index < items.length; index++) {
|
|
|
- items[index].style.background = "#00000032";
|
|
|
- let title = items[index].getElementsByClassName("item-title");
|
|
|
- console.log("textContent", title[0].textContent);
|
|
|
- let itemOther = this.benchList.find(
|
|
|
- (b) => parseInt(b.id) == parseInt(title[0].textContent)
|
|
|
- );
|
|
|
- itemOther.selected = false;
|
|
|
- if (parseInt(benchId) == parseInt(title[0].textContent)) {
|
|
|
- items[index].style.background = "#000000C0";
|
|
|
- this.currentBench = this.benchList.find((b) => b.id == benchId);
|
|
|
- this.currentBench.selected = true;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- handleCloseImg(benchId) {
|
|
|
- console.log("benchId", benchId);
|
|
|
- var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
|
|
|
- var objRBL = JSON.parse(strRemoteBenchList);
|
|
|
- if (objRBL) {
|
|
|
- for (var i = 0; i < objRBL.length; i++) {
|
|
|
- if (parseInt(objRBL[i]) == parseInt(benchId)) {
|
|
|
- console.log("images", this.images);
|
|
|
-
|
|
|
- for (var ii = 0; ii < this.images.length; ii++) {
|
|
|
- if (parseInt(this.images[ii].alt) == parseInt(benchId)) {
|
|
|
- this.images.splice(ii, 1);
|
|
|
- console.log("images", this.images);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //delete objRBL[i];
|
|
|
- objRBL.splice(i, 1);
|
|
|
- console.log("objRBL", objRBL);
|
|
|
- window.localStorage.setItem(
|
|
|
- "remoteBenchList",
|
|
|
- JSON.stringify(objRBL)
|
|
|
- );
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-<style scoped>
|
|
|
-.origin-basic {
|
|
|
- padding: 15px 20px;
|
|
|
- color: #ccc;
|
|
|
- font-size: 12px;
|
|
|
-}
|
|
|
-.origin-basic div {
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-.origin-basic div span {
|
|
|
- margin-right: 12px;
|
|
|
-}
|
|
|
-.origin-basic h2 {
|
|
|
- cursor: pointer;
|
|
|
- font-size: 14px;
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-:deep() .square {
|
|
|
- height: 47.79vh;
|
|
|
-}
|
|
|
-</style>
|