Commit fd56440c by hank

bug

parent 6e910a21
NODE_ENV='development'
VUE_APP_BASE_API='http://39.105.231.218:8090'
\ No newline at end of file
VUE_APP_BASE_API='http://47.95.238.195:8090'
\ No newline at end of file
NODE_ENV='production'
VUE_APP_BASE_API='http://39.105.231.218:8090'
\ No newline at end of file
VUE_APP_BASE_API='http://47.95.238.195:8090'
\ No newline at end of file
......@@ -78,6 +78,8 @@ commit auto fix eslint
|cancelEdit |`取消编辑状态`| 客户端|
|setData |`设置编辑项数据`| 客户端|
|goPage |`选择编辑页面`| 客户端|
|pageChange |`页面变化`| 模板页|
|editPage |`客户端编辑模板`| 客户端|
|getCurrentPage |`获取当前展示页面`| 客户端|
|createPage |`添加页面`| 客户端|
|deletePage |`删除页面`| 客户端|
......
......@@ -18,7 +18,6 @@
</div>-->
<div class="top-right">
<span class="im">*</span>
影片名称:
<input type="text" v-model="templateData.filmName" />
<div style>
......@@ -30,8 +29,8 @@
<iframe
class="iframe"
v-if="loaded"
@touchmove.prevent=""
@click.prevent=""
@touchmove.prevent
@click.prevent
style="height:70vw;"
v-show="!isPreview"
@load="setList"
......@@ -61,6 +60,7 @@
class="editbtn"
v-for="(item, index) in templateData.listData[currentPage]['list']"
:key="index"
@dblclick="goEdit(index, item)"
@click="goEdit(index, item)"
>{{item.name}}</span>
</div>
......@@ -258,7 +258,6 @@ export default {
// }
},
mounted() {
window.onload = function() {
console.log(window.frames[0]);
// window.frames[0].postMessage(
......@@ -360,10 +359,19 @@ export default {
});
},
goEdit(index, edit) {
this.editPage = this.currentPage;
this.editIndex = index;
this.editObj = edit;
if (this.editIndex === index) {
this.show = true;
return;
}
this.editPage = this.currentPage;
this.editIndex = index;
this.message({
type: "editPage",
page: this.currentPage,
index: index
});
},
valueChange2(editObj, index) {
this.message({
......@@ -420,12 +428,20 @@ export default {
this.templateData.defaultData = pagesData;
});
this.loaded = true;
document.querySelector('.iframe').addEventListener('touchmove', function(e) {
e.preventDefault()
}, false)
document.querySelector('.iframe').addEventListener('click', function(e) {
e.preventDefault()
}, false)
document.querySelector(".iframe").addEventListener(
"touchmove",
function(e) {
e.preventDefault();
},
false
);
document.querySelector(".iframe").addEventListener(
"click",
function(e) {
e.preventDefault();
},
false
);
// console.log()
// this.setList()
});
......
......@@ -146,6 +146,7 @@ export default {
<style lang="scss" scoped>
.edit-container {
padding-bottom: 50px;
.bgeee {
width: 100%;
background: #eee;
......
......@@ -9,7 +9,9 @@
</div>
<van-list v-model="loading" :finished="finished" finished-text @load="onLoad">
<div class="device-list">
<div class="device-item" v-for="item in list" :key="item.equipmentId">
<div v-for="item in list" :key="item.equipmentId">
<van-swipe-cell>
<div class="device-item">
<div class="icon">
<img :src="item.equipmentUrl" alt />
</div>
......@@ -18,6 +20,17 @@
<div class="device-online">{{item.equipmentState === 'ONLINE' ? '在线' : '离线'}}</div>
</div>
</div>
<template slot="right">
<van-button
@click="deleteDevice(item)"
class="delte-btn"
square
type="danger"
text="删除"
/>
</template>
</van-swipe-cell>
</div>
</div>
</van-list>
</div>
......@@ -72,7 +85,12 @@
<script>
import NavBar from "@/views/layout/navbar";
import { getFilmDeviceList, getFilmAddDeviceList, bindDeviceToFilm } from "@/api/api";
import {
getFilmDeviceList,
getFilmAddDeviceList,
bindDeviceToFilm,
} from "@/api/api";
export default {
data() {
......@@ -116,6 +134,7 @@ export default {
}
})
.catch(() => {
this.finished = true;
this.loading = false;
});
},
......@@ -132,19 +151,37 @@ export default {
done();
}
},
deleteDevice(item) {
this.$dialog
.confirm({
message: "确定解绑吗?"
})
.then(() => {
bindDeviceToFilm([item.equipmentId]).then(() => {
this.$toast.success("解绑成功");
this.page = 0
this.finished = false
this.list = []
this.getFilmAddDeviceList()
});
});
},
checkAll() {
console.log("checkAll");
if (!this.isCheck.length) {
this.deviceChecked = [];
} else {
this.deviceChecked = this.dataList.filter(device => {
this.deviceChecked = this.dataList
.filter(device => {
if (!device.isUse) {
return device.equipmentId;
}
}).map(device => {
return device.equipmentId
})
console.log(this.deviceChecked );
.map(device => {
return device.equipmentId;
});
console.log(this.deviceChecked);
}
},
toggle(index) {
......@@ -155,16 +192,18 @@ export default {
this.page++;
},
enter() {
if(this.deviceChecked.length) {
bindDeviceToFilm(this.deviceChecked, this.$route.query.filmId).then(() => {
this.$toast.success('绑定成功')
this.show = false
this.page = 0
this.list = []
this.finished = false
})
if (this.deviceChecked.length) {
bindDeviceToFilm(this.deviceChecked, this.$route.query.filmId).then(
() => {
this.$toast.success("绑定成功");
this.show = false;
this.page = 0;
this.list = [];
this.finished = false;
}
);
} else {
this.show = false
this.show = false;
}
}
},
......@@ -271,6 +310,9 @@ export default {
right: 5px;
}
}
.delte-btn {
height: 123px;
}
}
</style>
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 sign in to comment