master
xy 1 year ago
parent 8ce0535735
commit 149baff842

@ -133,7 +133,7 @@ export default {
}, },
methods: { methods: {
open(url) { open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW_API}?url=${encodeURIComponent( this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64") new Buffer(url).toString("base64")
)}`; )}`;

@ -101,7 +101,7 @@ export default {
}, },
methods: { methods: {
open(url) { open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW_API}?url=${encodeURIComponent( this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64") new Buffer(url).toString("base64")
)}`; )}`;

@ -2,7 +2,7 @@
<div style="width: 100%;height: 100%"> <div style="width: 100%;height: 100%">
<div id="map"> <div id="map">
</div> </div>
<tooltip ref="tooltip" class="tooltip-table" :info="params"></tooltip> <tooltip ref="tooltip" class="tooltip-table" :info="params" :style="{ left: mapTooltipPos.x + 'px', top: mapTooltipPos.y + 'px' }"></tooltip>
</div> </div>
</template> </template>
@ -55,8 +55,12 @@ export default {
}, },
} }
}, },
params: {}, params: [],
mapTooltip: "", mapTooltip: "",
mapTooltipPos: {
x: 0,
y: 0,
}
} }
}, },
methods: { methods: {
@ -66,6 +70,8 @@ export default {
this.chart = echarts.init(document.querySelector("#map")) this.chart = echarts.init(document.querySelector("#map"))
this.setOption() this.setOption()
this.chart.on("click", params => { this.chart.on("click", params => {
this.mapTooltipPos.x = params.event.offsetX;
this.mapTooltipPos.y = params.event.offsetY;
this.params = params?.data?.originalData; this.params = params?.data?.originalData;
this.$refs.tooltip.show() this.$refs.tooltip.show()
}) })
@ -219,7 +225,7 @@ export default {
.tooltip-table { .tooltip-table {
position: fixed; position: fixed;
z-index: 99999996; z-index: 99999996;
top: 10%; top: 0;
left: 10%; left: 0;
} }
</style> </style>

@ -1,7 +1,9 @@
<template> <template>
<div v-show="isShow"> <transition name="fade">
<Table class="table" :data="showInfo" :columns="columns"></Table> <div v-show="isShow" ref="tooltip">
</div> <Table class="table" height="500" stripe :data="showInfo" :columns="columns"></Table>
</div>
</transition>
</template> </template>
<script> <script>
@ -22,13 +24,6 @@ export default {
key: "name", key: "name",
title: "资产名称" title: "资产名称"
}, },
{
key: "land_id",
title: "资产类型",
render: (h,{ row }) => {
return h('span',row.hasOwnProperty("land_id") ? "房产" : "土地")
}
},
{ {
key: "dengjimianji", key: "dengjimianji",
title: "登记面积" title: "登记面积"
@ -42,40 +37,54 @@ export default {
}, },
hide () { hide () {
this.isShow = false; this.isShow = false;
},
clickListener (e) {
const tooltipDom = this.$el;
if (!(tooltipDom === e.target || tooltipDom.contains(e.target))) {
this.hide()
}
} }
}, },
computed: { computed: {
showInfo () { showInfo () {
return this.info?.slice(this.index, this.index + 8) || []; return this.info
//return this.info?.slice(this.index, this.index + 8) || [];
} }
}, },
watch: { watch: {
isShow (newVal) {
if (newVal) {
setTimeout(() => {
document.body.addEventListener('click', this.clickListener)
},500)
} else {
document.body.removeEventListener('click', this.clickListener)
}
},
info (newData) { info (newData) {
this.$nextTick(() => { // this.$nextTick(() => {
clearInterval(this.timer) // clearInterval(this.timer)
if (this.info?.length > 8) { // if (this.info?.length > 8) {
this.timer = setInterval(() => { // this.timer = setInterval(() => {
this.index = (++this.index) % (this.info?.length || 0); // this.index = (++this.index) % (this.info?.length || 0);
},3000) // },3000)
} else { // } else {
this.index = 0; // this.index = 0;
} // }
}) // })
} }
}, },
mounted() {
},
beforeDestroy () { beforeDestroy () {
clearInterval(this.timer) clearInterval(this.timer)
console.log('des')
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.table { .table {
width: 320px; width: 350px;
height: auto;
max-height: 400px;
overflow-y: hidden;
} }
::v-deep .ivu-table {} ::v-deep .ivu-table {}

@ -37,10 +37,27 @@
<div>img</div> <div>img</div>
</template> </template>
<template v-else-if="item.edit_input === 'files'"> <template v-else-if="item.edit_input === 'files'">
<div> <div
<a v-for="img in detail[`${item.field}_upload_details`]" :href="img.url" target="_blank"> v-for="(item, index) in detail[`${item.field}_upload_details`]"
{{ img.original_name }} style="display: flex; justify-content: space-between;margin-bottom: 4px;"
</a> >
<a :download="item.url">{{++index}}.{{ item.original_name }}</a>
<div>
<el-button
type="primary"
icon="el-icon-download"
circle
size="mini"
@click="down(item)"
></el-button>
<el-button
type="primary"
icon="el-icon-search"
circle
size="mini"
@click="open(item.url)"
></el-button>
</div>
</div> </div>
</template> </template>
<template v-else> <template v-else>
@ -143,7 +160,7 @@ export default {
}, },
methods: { methods: {
open(url) { open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW_API}?url=${encodeURIComponent( this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64") new Buffer(url).toString("base64")
)}`; )}`;

@ -594,14 +594,13 @@ 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 && numberLength !== 0) { if (numberLength === temp && numberLength !== 0 && i.edit_input !== 'radio') {
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) {
this.table.find(a => a.prop === i.field).align = 'left'; this.table.find(a => a.prop === i.field).align = 'left';
} }
}) })
console.log(this.table)
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }

@ -548,7 +548,7 @@ export default {
}) })
}) })
}, },
["select"]: (_) => { ["select"]: (selection, row) => {
if (selection.find(i => i.id === row.id)) { if (selection.find(i => i.id === row.id)) {
this.nowAssets.push({ this.nowAssets.push({
id: row.id, id: row.id,
@ -733,7 +733,7 @@ export default {
}) })
}) })
}, },
["select"]: (_) => { ["select"]: (selection, row) => {
if (selection.find(i => i.id === row.id)) { if (selection.find(i => i.id === row.id)) {
this.nowAssets.push({ this.nowAssets.push({
id: row.id, id: row.id,
@ -951,7 +951,7 @@ export default {
content: `${this.type === "add" ? "新增" : "编辑"}成功`, content: `${this.type === "add" ? "新增" : "编辑"}成功`,
}); });
this.$emit("refresh"); this.$emit("refresh");
this.$router.back(); this.$router.push("/lease");
}); });
}, },
}, },
@ -990,17 +990,11 @@ export default {
} }
} }
}); });
this.columns = newVal.length > 11 ? "2" : "1";
}, },
//immediate: true, //immediate: true,
}, },
dialogVisible(val) { dialogVisible(val) {
if (val) { if (val) {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor" || this.type === "change") { if (this.type === "editor" || this.type === "change") {
this.$nextTick(() => this.getDetail()); this.$nextTick(() => this.getDetail());
} }
@ -1096,7 +1090,7 @@ export default {
.form-body { .form-body {
display: grid; display: grid;
grid-gap: 10px; grid-gap: 10px;
grid-template-columns: repeat(var(--column-num), 1fr); grid-template-columns: repeat(2, 1fr);
} }
::v-deep .el-input-number input { ::v-deep .el-input-number input {
text-align: right; text-align: right;

Loading…
Cancel
Save