master
xy 2 years ago
parent d531e6f014
commit 8ce0535735

@ -90,6 +90,6 @@
} }
} }
.el-menu-item,.el-submenu__title,.el-table,.el-descriptions,.v-table .el-table__header th { .el-menu-item,.el-submenu__title,.el-table,.el-descriptions,.v-table .el-table__header th,.el-form-item__label,.el-input {
font-size: 15px!important; font-size: 15px!important;
} }

@ -51,6 +51,7 @@ export class CreateDialog {
props.onSuccess = (response, file, fileList) => { props.onSuccess = (response, file, fileList) => {
that.file[info.field] = fileList; that.file[info.field] = fileList;
that.form[info.field] = fileList.map(i => i.response?.id).filter(i => i)
}; };
props.onRemove = (file, fileList) => { props.onRemove = (file, fileList) => {

@ -775,7 +775,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp && !i._params) { if (numberLength === temp && !i._params && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -763,7 +763,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp && !i._params) { if (numberLength === temp && !i._params && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -601,7 +601,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp) { if (numberLength === temp && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -1,15 +1,22 @@
<template> <template>
<div id="map"> <div style="width: 100%;height: 100%">
<div id="map">
</div>
<tooltip ref="tooltip" class="tooltip-table" :info="params"></tooltip>
</div> </div>
</template> </template>
<script> <script>
import Vue from "vue"; import Vue from 'vue'
import * as echarts from "echarts"; import * as echarts from 'echarts'
import "echarts-gl"; import 'echarts-gl'
import WUXI from "@/assets/wuxi.json"; import WUXI from '@/assets/wuxi.json'
import tooltip from "./tooltip.vue" import tooltip from './tooltip.vue'
export default { export default {
components: {
tooltip
},
data() { data() {
return { return {
areas: new Map([ areas: new Map([
@ -58,14 +65,16 @@ export default {
echarts.registerMap("wuxi", WUXI); echarts.registerMap("wuxi", WUXI);
this.chart = echarts.init(document.querySelector("#map")) this.chart = echarts.init(document.querySelector("#map"))
this.setOption() this.setOption()
this.chart.on("click", params => {
this.params = params?.data?.originalData;
this.$refs.tooltip.show()
})
}, },
setTooltip () { setTooltip () {
const div = document.createElement("div"); this.mapTooltip = new Vue({
let mapTooltip = new Vue({
render: h => h(tooltip, { props: { info: this.params?.data?.originalData } }) render: h => h(tooltip, { props: { info: this.params?.data?.originalData } })
}) });
mapTooltip.$mount(div); document.body.appendChild(this.mapTooltip.$el)
this.mapTooltip = mapTooltip.$el;
}, },
setOption () { setOption () {
this.chart.setOption(this.chartOption); this.chart.setOption(this.chartOption);
@ -74,14 +83,14 @@ export default {
computed: { computed: {
chartOption () { chartOption () {
return { return {
tooltip: { // tooltip: {
trigger: 'item', // trigger: 'item',
formatter: (params) => { // formatter: (params) => {
this.params = params; // this.params = params;
//
return this.mapTooltip; // return this.mapTooltip;
}, // },
}, // },
series: [{ series: [{
type: 'map3D', // mapmap3D type: 'map3D', // mapmap3D
map: 'wuxi', // map: 'wuxi', //
@ -172,13 +181,13 @@ export default {
value: 0, value: 0,
originalData: [] originalData: []
})) }))
houses.forEach(item => { // houses.forEach(item => {
let find = temp.find(v => v.tag === item.area) // let find = temp.find(v => v.tag === item.area)
if (find) { // if (find) {
find.value++; // find.value++;
find.originalData.push(item) // find.originalData.push(item)
} // }
}) // })
lands.forEach(item => { lands.forEach(item => {
let find = temp.find(v => v.tag === item.area) let find = temp.find(v => v.tag === item.area)
if (find) { if (find) {
@ -197,7 +206,6 @@ export default {
}, },
mounted() { mounted() {
this.initMap(); this.initMap();
this.setTooltip();
} }
} }
</script> </script>
@ -208,4 +216,10 @@ export default {
height: 100%; height: 100%;
background: linear-gradient(to bottom, #00000022 , #61b9ac66); background: linear-gradient(to bottom, #00000022 , #61b9ac66);
} }
.tooltip-table {
position: fixed;
z-index: 99999996;
top: 10%;
left: 10%;
}
</style> </style>

@ -1,5 +1,5 @@
<template> <template>
<div> <div v-show="isShow">
<Table class="table" :data="showInfo" :columns="columns"></Table> <Table class="table" :data="showInfo" :columns="columns"></Table>
</div> </div>
</template> </template>
@ -7,10 +7,14 @@
<script> <script>
export default { export default {
props: { props: {
info: Array info: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
isShow: false,
index: 0, index: 0,
timer: null, timer: null,
columns: [ columns: [
@ -32,7 +36,14 @@ export default {
] ]
} }
}, },
methods: {}, methods: {
show () {
this.isShow = true;
},
hide () {
this.isShow = false;
}
},
computed: { computed: {
showInfo () { showInfo () {
return this.info?.slice(this.index, this.index + 8) || []; return this.info?.slice(this.index, this.index + 8) || [];

@ -188,8 +188,11 @@ export default {
{ {
"prop": "area", "prop": "area",
"label": "区域", "label": "区域",
"width": 0, "width": 80,
"align": "center" "align": "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
}, },
{ {
"prop": "name", "prop": "name",
@ -411,8 +414,11 @@ export default {
{ {
"prop": "area", "prop": "area",
"label": "区域", "label": "区域",
"width": 0, "width": 80,
"align": "center" "align": "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
}, },
{ {
"prop": "name", "prop": "name",
@ -550,6 +556,15 @@ export default {
}, },
data() { data() {
return { return {
wxAreas: [
"宜兴市",
"惠山区",
"新吴区",
"梁溪区",
"江阴市",
"滨湖区",
"锡山区",
],
nowAssets: [], nowAssets: [],
houseDialog: false, houseDialog: false,
landDialog: false, landDialog: false,
@ -683,10 +698,12 @@ export default {
// }) // })
// this.form.id_lease_plans_lease_id_relation = this.leasePlans; // this.form.id_lease_plans_lease_id_relation = this.leasePlans;
save(Object.assign(this.form, { table_name: 'lets' })).then(res => { save(Object.assign(this.form, { table_name: 'lets' })).then(res => {
Promise.all(this.originalForm.id_lets_to_assets_let_id_relation?.map(i => destroy({ if (this.type !== 'add') {
id: i.id, Promise.all(this.originalForm.id_lets_to_assets_let_id_relation?.map(i => destroy({
table_name: "lets_to_assets" id: i.id,
},false))) table_name: "lets_to_assets"
},false)))
}
let leaseToAssetsData = this.nowAssets.map(item => ({ let leaseToAssetsData = this.nowAssets.map(item => ({
id: item._relation_id, id: item._relation_id,
land_id: !item.hasOwnProperty("land_id") ? item.id : "", land_id: !item.hasOwnProperty("land_id") ? item.id : "",

@ -33,6 +33,16 @@
<template v-if="item.edit_input === 'richtext'"> <template v-if="item.edit_input === 'richtext'">
<div v-html="detail[item.field]"></div> <div v-html="detail[item.field]"></div>
</template> </template>
<template v-else-if="item.edit_input === 'file'">
<div>img</div>
</template>
<template v-else-if="item.edit_input === 'files'">
<div>
<a v-for="img in detail[`${item.field}_upload_details`]" :href="img.url" target="_blank">
{{ img.original_name }}
</a>
</div>
</template>
<template v-else> <template v-else>
{{ contentFormat(item) }} {{ contentFormat(item) }}
</template> </template>

@ -594,7 +594,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp) { if (numberLength === temp && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -590,7 +590,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp) { if (numberLength === temp && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -589,7 +589,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp) { if (numberLength === temp && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

@ -853,7 +853,7 @@ export default {
}); });
} }
} else { } else {
let house = this.originalForm.house?.find( let house = this.originalForm.houses?.find(
(house) => house.id === item.house_id (house) => house.id === item.house_id
); );
if (house) { if (house) {
@ -892,16 +892,18 @@ export default {
this.form.let_id = this.$route.params.letId; this.form.let_id = this.$route.params.letId;
save(Object.assign(this.form, { table_name: "leases" })).then((res) => { save(Object.assign(this.form, { table_name: "leases" })).then((res) => {
Promise.all([ if (this.type !== 'add') {
...this.originalForm.id_leases_to_assets_lease_id_relation.map(i => destroy({ Promise.all([
id: i.id, ...this.originalForm.id_leases_to_assets_lease_id_relation?.map(i => destroy({
table_name: "leases_to_assets" id: i.id,
},false)), table_name: "leases_to_assets"
...this.originalForm.id_lease_plans_lease_id_relation.map(i => destroy({ },false)),
id: i.id, ...this.originalForm.id_lease_plans_lease_id_relation?.map(i => destroy({
table_name: "lease_plans" id: i.id,
},false)) table_name: "lease_plans"
]) },false))
])
}
let leaseToAssetsData = this.nowAssets.map(item => ({ let leaseToAssetsData = this.nowAssets.map(item => ({
id: item._relation_id, id: item._relation_id,
land_id: !item.hasOwnProperty("land_id") ? item.id : "", land_id: !item.hasOwnProperty("land_id") ? item.id : "",

@ -585,7 +585,7 @@ export default {
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0; numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++; temp++;
} }
if (numberLength === temp) { if (numberLength === temp && numberLength !== 0) {
this.table.find(a => a.prop === i.field).align = 'right'; this.table.find(a => a.prop === i.field).align = 'right';
} }
else if (Math.abs(maxLength - minLength) > 4) { else if (Math.abs(maxLength - minLength) > 4) {

Loading…
Cancel
Save