错误处理

main
许宏杰 6 months ago
parent e259e7bd89
commit 65f03685d0

@ -1,10 +1,10 @@
module.exports = { module.exports = {
plugins: { plugins: {
"postcss-px-to-viewport": { "postcss-px-to-viewport": {
// viewportWidth: 1920, viewportWidth: 1920,
viewportWidth: 6656, // viewportWidth: 6656,
viewportHeight: 1792, // viewportHeight: 1792,
}, },
}, },
}; };

@ -478,6 +478,7 @@ export default {
if (this.timer) clearInterval(this.timer); if (this.timer) clearInterval(this.timer);
const result = await getCarByCarplate(this.searchQuery); const result = await getCarByCarplate(this.searchQuery);
if (result.list) { if (result.list) {
this.searchText = "";
if (result.list[0].stateCn.includes("离线")) { if (result.list[0].stateCn.includes("离线")) {
this.$modal.msgError(`该车${result.list[0].stateCn}!`); this.$modal.msgError(`该车${result.list[0].stateCn}!`);
return; return;

@ -163,12 +163,16 @@ export default {
}); });
}, },
removeProvinceLevelWords(str) {
return str.replace(/省|市|自治区/g, "");
},
async getEchartsOption() { async getEchartsOption() {
let res = await getProvince(); let res = await getProvince();
let items = []; let items = [];
res.data.forEach((item) => { res.data.forEach((item) => {
const label = item.city.replace("省", ""); const label = this.removeProvinceLevelWords(item.city);
const centreItem = provinceCentre.china[label]; const centreItem = provinceCentre.china[label];
if (item.city == "江苏省") { if (item.city == "江苏省") {
items.push({ items.push({

@ -19,8 +19,8 @@ module.exports = {
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
// publicPath: process.env.NODE_ENV === "production" ? "/demo/yunkunPc" : "/", // publicPath: process.env.NODE_ENV === "production" ? "/demo/yunkunPc" : "/",
// publicPath: process.env.NODE_ENV === "production" ? "/yunkunPc" : "/", publicPath: process.env.NODE_ENV === "production" ? "/yunkunPc" : "/",
publicPath: process.env.NODE_ENV === "production" ? "/yunkunPc-big" : "/", // publicPath: process.env.NODE_ENV === "production" ? "/yunkunPc-big" : "/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和 baseUrl 的生产环境路径一致默认dist // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和 baseUrl 的生产环境路径一致默认dist
outputDir: "dist", outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)

Loading…
Cancel
Save