大屏数据调整后的修改

master
xy 1 year ago
parent 846b3805c2
commit 9571fac04b

@ -13,7 +13,7 @@
<p>{{ time.format('YYYY年MM月DD日 HH:mm:ss') }}</p>
<p>{{ time.format('dddd') }}</p>
</div>
<SvgIcon icon-class="home" style="color: #75f9e2;width: 45px;height: 45px;cursor: pointer;" @click.native="$router.back()"></SvgIcon>
<SvgIcon icon-class="home" style="color: #75f9e2;width: 45px;height: 45px;cursor: pointer;padding-right: 8px;" @click.native="$router.back()"></SvgIcon>
</div>
</template>

@ -6,9 +6,9 @@
<div class="info-window" ref="leaseInfoWindow" v-show="isShowWindow">
<el-descriptions border :column="2">
<el-descriptions-item label="地块名称">
{{ row.dikuaimingcheng }}
{{ row._asset ? row._asset.name : '' }}
</el-descriptions-item>
<el-descriptions-item label="出租">
<el-descriptions-item label="出租">
{{ row.chuzufang }}
</el-descriptions-item>
<el-descriptions-item label="承租方">
@ -23,9 +23,6 @@
<el-descriptions-item label="年租赁价">
{{ row.nianzujindanjia }}
</el-descriptions-item>
<el-descriptions-item label="实收租金">
{{ row.shishouzujin }}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
@ -43,7 +40,33 @@ export default {
},
computed: {
leases () {
return this.$store.state.bigdata.leases;
let temp = [];
let a = this.$store.state.bigdata.leases;
this.$store.state.bigdata.leases.forEach(item => {
if (item.land instanceof Array && item.land.length > 0) {
item.land.forEach(land => {
temp.push({
...item,
_asset: {
name: land.name,
location: land.zichanweizhi
}
})
})
} else if (item.houses instanceof Array && item.houses.length > 0) {
item.houses.forEach(house => {
temp.push({
...item,
_asset: {
name: house.name,
location: house.zichanweizhi
}
})
})
}
})
console.log(temp,a)
return temp;
},
type () {
return this.$store.state.bigdata.type;
@ -53,7 +76,7 @@ export default {
pickRow({ row }) {
this.row = row;
this.isShowWindow = true;
let location = row.land_id_lands_id_relation ? row.land_id_lands_id_relation.zichanweizhi : row.house_id_houses_id_relation.zichanweizhi;
let location = row._asset.location
if (location) {
let lat, lng;
[lng, lat] = location.split(",");
@ -89,7 +112,7 @@ export default {
this.markerList = [];
this.leases.forEach((item) => {
let location = item.land_id_lands_id_relation ? item.land_id_lands_id_relation.zichanweizhi : item.house_id_houses_id_relation.zichanweizhi;
let location = item._asset.location;
if (location) {
let lat, lng;
[lng, lat] = location.split(",");
@ -108,11 +131,11 @@ export default {
let markerSpan = document.createElement("span");
markerSpan.setAttribute("class", "map-marker__text");
markerSpan.innerText =
item.dikuaimingcheng?.length > 4
? item.dikuaimingcheng.slice(0, 2) +
item._asset?.name?.length > 4
? item._asset?.name?.slice(0, 2) +
".." +
item.dikuaimingcheng.slice(item.dikuaimingcheng.length - 2)
: item.dikuaimingcheng;
item._asset?.name?.slice(item._asset?.name?.length - 2)
: item._asset?.name;
markerContent.appendChild(markerImg);
markerContent.appendChild(markerSpan);
marker.setContent(markerContent);
@ -190,7 +213,7 @@ export default {
if (this.leases.length > 0) {
setTimeout(() => {
let data = this.leases[0]
let location = data.land_id_lands_id_relation ? data.land_id_lands_id_relation.zichanweizhi : data.house_id_houses_id_relation.zichanweizhi;
let location = data._asset?.location;
let lat, lng;
[lng, lat] = location.split(",");
this.map.panTo([lng, lat]);

@ -52,8 +52,8 @@ export default {
if (this.$store.state.bigdata.assets[1]) {
return {
data: this.$store.state.bigdata.assets[1].map(item => ({
name: item.name.length > 16 ? (item.name.slice(0, 14) + '...') : item.name,
value: item.dengjimianji ?? 0
name: item?.name?.length > 16 ? (item.name.slice(0, 14) + '...') : item.name,
value: (item.dengjimianji || item.shijimianji) ?? 0
})),
carousel: 'single',
unit: '平方',
@ -65,8 +65,8 @@ export default {
if (this.$store.state.bigdata.leases) {
return {
data: this.$store.state.bigdata.leases.map(item => ({
name: item.dikuaimingcheng.length > 16 ? (item.dikuaimingcheng.slice(0, 14) + '...') : item.dikuaimingcheng,
value: item.zulinmianji ?? 0
name: [...item.land,...item.houses].map(i => i.name)?.toString()?.slice(0, 15),
value: item.id_leases_to_assets_lease_id_relation?.reduce((pre, cur) => pre + Number(cur.chuzumianji),0)
})),
carousel: 'single',
unit: '平方',

@ -41,7 +41,7 @@ export default {
return {
data: this.$store.state.bigdata.assets[0].map(item => ({
name: item.name.length > 16 ? (item.name.slice(0, 14) + '...') : item.name,
value: item.dengjimianji ?? 0
value: (item.dengjimianji || item.shijimianji) ?? 0
})),
carousel: 'single',
unit: '平方',
@ -53,8 +53,8 @@ export default {
if (this.$store.state.bigdata.adventLeases) {
return {
data: this.$store.state.bigdata.adventLeases.map(item => ({
name: item.dikuaimingcheng.length > 16 ? (item.dikuaimingcheng.slice(0, 14) + '...') : item.dikuaimingcheng,
value: item.zulinmianji ?? 0
name: [...item.land,...item.houses].map(i => i.name)?.toString()?.slice(0, 15),
value: item.id_leases_to_assets_lease_id_relation?.reduce((pre, cur) => pre + Number(cur.chuzumianji),0)
})),
carousel: 'single',
unit: '平方',

@ -283,7 +283,6 @@ export default {
customFn: row => {
return (
<el-date-picker
readonly
style="width: 100%;"
size="small"
vModel={row.shijidaozhangriqi}
@ -791,8 +790,8 @@ export default {
// this.form.id_lease_plans_lease_id_relation = this.leasePlans;
save(Object.assign(this.form, { table_name: 'leases' })).then(res => {
let leaseToAssetsData = this.distinct([
...this.selectedLands,
...this.selectedHouses,
...this.selectedLands.map(i => ({...i,_TAG_: "land"})),
...this.selectedHouses.map(i => ({...i,_TAG_: "house"})),
...(() => {
let temp = [];
this.originalForm?.id_leases_to_assets_lease_id_relation?.forEach(item => {
@ -869,7 +868,7 @@ export default {
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
this.$router.back();
})
},
},

Loading…
Cancel
Save