Commit 8b2d2354 by 杨明

fixed

1 parent 05ad9835
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
</div> </div>
</div> </div>
</div> </div>
<GLDialog @onOk="savePoster" @onCancel="dialogVisible = false" v-loading="loadingDrag" title="创建活码海报" :visible.sync="dialogVisible"> <el-dialog title="创建活码海报" :visible.sync="dialogVisible">
<div class="poster-draggable-title">拖动活码可调整活码位置</div> <div class="poster-draggable-title">拖动活码可调整活码位置</div>
<div class="poster-draggable"> <div class="poster-draggable" v-loading="loadingDrag">
<div <div
class="poster-image" class="poster-image"
v-if="dragHeight" v-if="dragHeight"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
:style="{ :style="{
'background-image': 'url(' + codeUrl + ')' 'background-image': 'url(' + codeUrl + ')'
}" }"
:parent="true" parent=".poster-image"
@dragging="onDrag" @dragging="onDrag"
@resizing="onResize" @resizing="onResize"
:customId="index" :customId="index"
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
></vue-draggable-resizable> ></vue-draggable-resizable>
</div> </div>
</div> </div>
<!-- <span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="savePoster">确 定</el-button> <el-button size="small" type="primary" @click="savePoster">确 定</el-button>
</span> --> </span>
</GLDialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -252,11 +252,10 @@ export default { ...@@ -252,11 +252,10 @@ export default {
getDraggable(img_url) { getDraggable(img_url) {
let img = new Image() let img = new Image()
img.src = img_url img.src = img_url
let self = this img.onload = () => {
img.onload = function() { this.dragHeight = (img.height * 375) / img.width
self.dragHeight = (img.height * 375) / img.width this.dialogVisible = true
self.dialogVisible = true this.loading = false
self.loading = false
} }
} }
}, },
...@@ -300,6 +299,8 @@ export default { ...@@ -300,6 +299,8 @@ export default {
.poster-draggable { .poster-draggable {
display: flex; display: flex;
justify-content: center; justify-content: center;
// height: 500px;
// overflow: auto;
.poster-image { .poster-image {
background-size: 100% 100%; background-size: 100% 100%;
width: 375px; width: 375px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!