Commit fd56440c by hank

bug

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