Commit 79ef8d74 authored by 黄奎's avatar 黄奎

js修改

parent 849019bd
......@@ -90,15 +90,7 @@
<img style="width: 32px;height: 32px" :src="getIconLink('/Static/icon-close.png')">
</div>
</div>
<div class="pic-list" :style="style" v-if="picList && picList.length > 0">
<template v-for="(item, index) in picList">
<div :style="item" :key="index">
<img :src="item.pic_url" style="width: 100%;visibility: hidden;display: block;">
</div>
<img :src="item.pic_url" :key="index" style="width: 100%;visibility: hidden;display: block;">
</template>
</div>
<div :style="style" flex="dir:left main:center cross:center" v-else>
<div :style="calcstyle" flex="dir:left main:center cross:center">
<img style="width: auto;height: auto;max-width: 100%;max-height: 100%" :src="picUrl">
</div>
</div>
......@@ -145,7 +137,6 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item label="热区属性" v-if="mode == 'auth'">
<el-radio-group v-model="hotspotList[index].open_type">
<el-radio label="login" :disabled="radioDisabled('login')">登录按钮</el-radio>
......@@ -162,13 +153,9 @@
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import chooseMenu from "../common/chooseMenu.vue";
export default {
props: {
multiple: Boolean,
......@@ -185,14 +172,11 @@
type: Array,
default: []
},
isLink: Boolean,
picList: Array,
max: Number,
mode: String
},
data() {
return {
dialogVisible: false,
is_mousedown: false,
is_mousemove: false,
......@@ -213,10 +197,6 @@
zIndex: 99,
};
},
components: {
chooseMenu
},
watch: {
dialogVisible(oldVal, newVal) {
this.hotspotList = JSON.parse(JSON.stringify(this.hotspotArray))
......@@ -227,11 +207,13 @@
}
},
computed: {
style() {
return {
//获取高度和宽度
calcstyle() {
var objStyle = {
width: this.width,
height: this.height
};
return objStyle;
},
maxWidth() {
return parseFloat(this.width) - this.hotspotList[this.index].left;
......@@ -258,21 +240,8 @@
y: y
};
}
// 缩放比例
let zoom = 2;
// 获取图片距离浏览器的x/y(真实的尺寸,不受zoom属性影响)
// let position = getElementPosition(this.$refs.box);
// 获取父容器距离浏览器的x/y(真实的尺寸,不受zoom属性影响)
// let inside = getElementPosition(this.$refs.inside);
// 图片距离缩放容器左边和顶部
// let picX = (position.x - inside.x) / zoom;
// let picY = (position.y - inside.y) / zoom;
// 鼠标点下时距离浏览器的x/y(需要计算zoom属性的影响)
// position.x = e.clientX + (e.offsetX + picX) * (zoom - 1) - position.x;
// position.y = e.clientY + (e.offsetY + picY) * (zoom - 1) - position.y;
// position.x = (e.clientX - inside.x) * zoom - (position.x - inside.x);
// position.y = (e.clientY - inside.y) * zoom - (position.y - inside.y);
let position = {
x: e.offsetX * zoom,
y: e.offsetY * zoom
......@@ -359,16 +328,6 @@
}
return false;
},
//获取选择链接
getChoiceLink() {
//调用子组件方法
var obj = this.$refs.chooseMenu.getChooseMenu();
if (this.index > -1 && this.hotspotList.length > 0) {
this.hotspotList[this.index].link = obj
}
},
}
};
......
......@@ -32,7 +32,7 @@
<el-form-item label="热区">
<choiceAreaAuth ref="choiceAreaAuth" :multiple="true" :max="2" :pic-url="getIconLink(addMsg.AuthUrl)"
mode='auth' :hotspotArray="addMsg.AuthDataList" width="650px" height="700px"
@confirm="selectHotspot" :is-link="false">
@confirm="selectHotspot" >
<el-button size="mini">划分热区</el-button>
</choiceAreaAuth>
<div>注:需要划分两个热区:一个是登录按钮热区,一个是暂不登录按钮热区</div>
......
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