Commit 81183935 by 张杰

新增车型库缓存处理

1 parent 19e01ab0
......@@ -2,5 +2,10 @@ export default {
//更新全局baseURL
updateBaseURL(state, newBaseURL) {
state.baseURL = newBaseURL;
},
// 更新车型库
updateVehicleList(state, data) {
state.vehicleList = data;
}
}
......@@ -11,11 +11,12 @@ const state = {
email: '',
gender: '',
position: ''
}
},
vehicleList: [], //车型库数据
}
try {
} catch(e) {}
// try {
// } catch (e) { }
export default state;
\ No newline at end of file
......@@ -267,6 +267,7 @@ import {
} from "services/vehicle";
import { getOrgTree } from "services/common";
import AuthButton from "@/components/auth-button";
import moment from "moment";
export default {
data() {
const _this = this;
......@@ -1368,6 +1369,13 @@ export default {
// 获取车辆数据
getModels(resolve) {
let _this = this;
let vlist = _this.$store.state.vehicleList;
if (vlist && vlist.length > 0) {
_this.vehicleList = vlist;
this.vehicleListInit = true;
resolve();
return false;
}
GETVEHICLETREE().then((res) => {
if (res.code != 200) {
return false;
......@@ -1667,10 +1675,9 @@ export default {
},
// 选择文件
chooseFiles(){
this.$refs.importInputFile.click()
}
chooseFiles() {
this.$refs.importInputFile.click();
},
},
};
</script>
......@@ -1788,7 +1795,7 @@ export default {
}
.btn_default {
position: relative;
z-index:2;
z-index: 2;
background: #fff;
border: 1px solid #dcdfe6;
font-size: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!