Commit 5e077784 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化站点编辑

parent b6c3fb5e
......@@ -591,7 +591,9 @@ export default {
this.areaInfo.areaCode = areaCode;
this.areaInfo.areaName = areaName;
this.cityData = [proCode, cityCode, districtCode];
this.formInfo.modelIds = modelIds.map(Number);
if (modelIds) {
this.formInfo.modelIds = modelIds && modelIds.map(Number);
}
[
this.formInfo.amWorkStartTime,
this.formInfo.amWorkEndTime,
......@@ -602,7 +604,13 @@ export default {
amWorkEndTime,
pmWorkStartTime,
pmWorkEndTime,
].map(String);
].map((v) => {
if (v) {
return String(v);
} else {
return "";
}
});
});
},
// 保存
......
......@@ -307,7 +307,7 @@ export default {
if (res.data.code === 1) {
let { data, dict } = res.data.data;
data.forEach((v) => {
v.modelIds = v.modelIds.split(",");
v.modelIds = v.modelIds && v.modelIds.split(",");
v.modelData = Object.keys(dict.modelIds)
.reduce(
(pre, cur) => (
......@@ -328,7 +328,7 @@ export default {
let res = await siteInfo({ id: this.siteId });
if (res.data.code === 1) {
let { data, dict } = res.data;
data.modelIds = data.modelIds.split(",");
data.modelIds = data.modelIds && data.modelIds.split(",");
data.modelData = Object.keys(dict.modelIds)
.reduce(
(pre, cur) => (
......@@ -574,6 +574,10 @@ export default {
text-align: center;
color: #fff;
border-radius: 5px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment