|
@@ -1,7 +1,9 @@
|
|
|
|
+// import { resolve } from "core-js/fn/promise";
|
|
import * as benchApi from "../../../api/bench.js";
|
|
import * as benchApi from "../../../api/bench.js";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
async fetchBenchList({ commit }, data) {
|
|
async fetchBenchList({ commit }, data) {
|
|
|
|
+ // return new Promise(async(resolve, reject) => { })
|
|
try {
|
|
try {
|
|
let benchList = []
|
|
let benchList = []
|
|
if (data) {
|
|
if (data) {
|
|
@@ -10,19 +12,32 @@ export default {
|
|
benchList = await benchApi.fetchBenchList()
|
|
benchList = await benchApi.fetchBenchList()
|
|
}
|
|
}
|
|
commit("setBenchList", benchList.data.data);
|
|
commit("setBenchList", benchList.data.data);
|
|
- benchList.data.data.forEach(async b => {
|
|
|
|
- const bench = await benchApi.getBenchDetail(b.id);
|
|
|
|
- commit("setBenchDetail", bench.data.data)
|
|
|
|
- })
|
|
|
|
|
|
+ // benchList.data.data.forEach(async b => {
|
|
|
|
+ // const bench = await benchApi.getBenchDetail(b.id);
|
|
|
|
+ // commit("setBenchDetail", bench.data.data)
|
|
|
|
+ // console.log("台架数量刷新时间需晚于当前时间:", Date.now())
|
|
|
|
+ // })
|
|
|
|
+ // let pArr = [];
|
|
|
|
+ // benchList.data.data.forEach(b => {
|
|
|
|
+ // let p = new Promise(async(resolve, reject) => {
|
|
|
|
+ // const bench = await benchApi.getBenchDetail(b.id);
|
|
|
|
+ // commit("setBenchDetail", bench.data.data)
|
|
|
|
+ // console.log("台架数量刷新时间需晚于当前时间:", Date.now())
|
|
|
|
+ // resolve()
|
|
|
|
+ // })
|
|
|
|
+ // pArr.push(p)
|
|
|
|
+ // })
|
|
|
|
+ // await Promise.all(pArr)
|
|
} catch (err) {
|
|
} catch (err) {
|
|
console.log("error", "服务异常", 1000);
|
|
console.log("error", "服务异常", 1000);
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
- async getMatchedBench({commit}, data) {
|
|
|
|
|
|
+ async getMatchedBench({ commit }, data) {
|
|
let benchList = await benchApi.getMatchedBench(data);
|
|
let benchList = await benchApi.getMatchedBench(data);
|
|
commit("setMatchedBenchList", benchList.data.result.matchSuccessAgent)
|
|
commit("setMatchedBenchList", benchList.data.result.matchSuccessAgent)
|
|
},
|
|
},
|
|
- async getBenchDetail({commit}, benchId) {
|
|
|
|
|
|
+ async getBenchDetail({ commit }, benchId) {
|
|
try {
|
|
try {
|
|
const bench = await benchApi.getBenchDetail(benchId);
|
|
const bench = await benchApi.getBenchDetail(benchId);
|
|
commit("setBenchDetail", bench.data.data)
|
|
commit("setBenchDetail", bench.data.data)
|
|
@@ -30,31 +45,31 @@ export default {
|
|
console.log("error", "服务异常", 1000)
|
|
console.log("error", "服务异常", 1000)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- setBenchImgList({commit}, data) {
|
|
|
|
- commit('setBenchImgList',data)
|
|
|
|
|
|
+ setBenchImgList({ commit }, data) {
|
|
|
|
+ commit('setBenchImgList', data)
|
|
},
|
|
},
|
|
- removeBenchImgList({commit}, data) {
|
|
|
|
- commit('removeBenchImgList',data)
|
|
|
|
|
|
+ removeBenchImgList({ commit }, data) {
|
|
|
|
+ commit('removeBenchImgList', data)
|
|
},
|
|
},
|
|
- filterBenchList({commit}, data) {
|
|
|
|
|
|
+ filterBenchList({ commit }, data) {
|
|
commit('filterBenchList', data)
|
|
commit('filterBenchList', data)
|
|
},
|
|
},
|
|
setFilterBenchFlag({ commit }, flag) {
|
|
setFilterBenchFlag({ commit }, flag) {
|
|
commit('setFilterBenchFlag', flag)
|
|
commit('setFilterBenchFlag', flag)
|
|
},
|
|
},
|
|
- filterBenchListByName({commit}, value) {
|
|
|
|
|
|
+ filterBenchListByName({ commit }, value) {
|
|
commit('setFilterBenchListByName', value)
|
|
commit('setFilterBenchListByName', value)
|
|
},
|
|
},
|
|
- setMouseOverBench({commit}, data) {
|
|
|
|
|
|
+ setMouseOverBench({ commit }, data) {
|
|
commit('setMouseOverBench', data)
|
|
commit('setMouseOverBench', data)
|
|
},
|
|
},
|
|
- addRemoteBenchList({commit}, data) {
|
|
|
|
|
|
+ addRemoteBenchList({ commit }, data) {
|
|
commit('addRemoteBenchList', data);
|
|
commit('addRemoteBenchList', data);
|
|
},
|
|
},
|
|
- popRemoteBenchList({commit}, data) {
|
|
|
|
|
|
+ popRemoteBenchList({ commit }, data) {
|
|
commit('popRemoteBenchList')
|
|
commit('popRemoteBenchList')
|
|
},
|
|
},
|
|
- setCurrentBench({commit}, data) {
|
|
|
|
|
|
+ setCurrentBench({ commit }, data) {
|
|
commit('setCurrentBench', data)
|
|
commit('setCurrentBench', data)
|
|
}
|
|
}
|
|
};
|
|
};
|