From c1356549ec2af9be99674ab778894f250df65c89 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Thu, 22 Apr 2021 14:55:11 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/iscs_new/iscsDraw/index.vue | 7 +-
src/views/iscs_new/iscsDraw/iscsCanvas.vue | 107 +++++++++++----------
src/views/iscs_new/iscsDraw/statusList.vue | 40 +++++++-
src/views/iscs_new/iscsPreview/index.vue | 1 -
4 files changed, 92 insertions(+), 63 deletions(-)
diff --git a/src/views/iscs_new/iscsDraw/index.vue b/src/views/iscs_new/iscsDraw/index.vue
index 3538a33ee..c55493a57 100644
--- a/src/views/iscs_new/iscsDraw/index.vue
+++ b/src/views/iscs_new/iscsDraw/index.vue
@@ -2,7 +2,7 @@
@@ -162,9 +162,8 @@ export default {
onSelectCardTab() {
},
- saveStateList(stateList) {
+ setStateList(stateList) {
this.stateList = stateList;
- this.onSave();
},
onSelected(em) {
if (em.model) {
diff --git a/src/views/iscs_new/iscsDraw/iscsCanvas.vue b/src/views/iscs_new/iscsDraw/iscsCanvas.vue
index 4955f0745..363efe52a 100644
--- a/src/views/iscs_new/iscsDraw/iscsCanvas.vue
+++ b/src/views/iscs_new/iscsDraw/iscsCanvas.vue
@@ -63,7 +63,7 @@ export default {
this.destroy();
},
methods: {
- // 初始化窗口
+ // 初始化窗口
init() {
document.getElementById(this.iscsId).oncontextmenu = function (e) {
return false;
@@ -82,55 +82,56 @@ export default {
offsetX: 0,
offsetY: 0
},
- plugins: [
- ShapeBuilder,
- // ShapeProperty,
- ShapeContextMenu
- ]
+ plugins: [
+ ShapeBuilder,
+ // ShapeProperty,
+ ShapeContextMenu
+ ]
});
- const option = {
- panEnable: true,
- zoomEnable: true,
- keyEnable: true,
- draggle: true,
- selecting: true,
- selectable: true,
- reflect: true
- }
- if (this.$route.query.id) {
- setTimeout(_ => {
- Idb.select('composeTemplateList', this.$route.query.id).then(resp => {
- this.$iscs.setMap([], {
- elementList: resp.shapeList||[],
- composeList: resp.composeList||[]
- }, option);
+ const option = {
+ panEnable: true,
+ zoomEnable: true,
+ keyEnable: true,
+ draggle: true,
+ selecting: true,
+ selectable: true,
+ reflect: true
+ };
+ if (this.$route.query.id) {
+ setTimeout(_ => {
+ Idb.select('composeTemplateList', this.$route.query.id).then(resp => {
+ this.$iscs.setMap([], {
+ elementList: resp.shapeList || [],
+ composeList: resp.composeList || []
+ }, option);
EventBus.$emit('getComposeElemList');
- }).catch(error => {
- this.$iscs.setMap([], {
- elementList: [],
- composeList: []
- }, option);
- })
- }, 1000)
- } else {
- this.$iscs.setMap([], {
- elementList: [],
- composeList: []
- }, option);
- }
+ this.$emit('setStateList', resp.stateList);
+ }).catch(error => {
+ this.$iscs.setMap([], {
+ elementList: [],
+ composeList: []
+ }, option);
+ });
+ }, 1000);
+ } else {
+ this.$iscs.setMap([], {
+ elementList: [],
+ composeList: []
+ }, option);
+ }
Vue.prototype.$iscs = this.$iscs;
this.$iscs.on('viewLoaded', this.onViewLoaded, this);
this.$iscs.on('contextmenu', this.onContextMenu, this);
this.$iscs.on('click', this.onClick, this);
- this.$iscs.on('reflect', this.onReflect, this);
+ this.$iscs.on('reflect', this.onReflect, this);
this.$iscs.on('keyboard', this.onKeyboard, this);
window.document.oncontextmenu = function () {
return false;
};
},
- // 视图加载完成
+ // 视图加载完成
onViewLoaded(e) {
},
// 键盘快捷键事件
@@ -138,38 +139,38 @@ export default {
console.log(hook);
},
// 点击选择事件
- onClick(em={}) {
- this.$emit('selected', em);
+ onClick(em = {}) {
+ this.$emit('selected', em);
+ },
+ onReflect(em = {}) {
+ this.$emit('selected', this.$iscs.getShapeByCode(em.code));
},
- onReflect(em={}) {
- this.$emit('selected', this.$iscs.getShapeByCode(em.code));
- },
// 右键点击事件
- onContextMenu(em={}) {
- this.$emit('contextMenu', em.model);
+ onContextMenu(em = {}) {
+ this.$emit('contextMenu', em.model);
},
- // 执行操作
- doAction(list) {
- this.$iscs && this.$iscs.render(list);
- },
- // 消息处理
- stateMessage(val) {
+ // 执行操作
+ doAction(list) {
+ this.$iscs && this.$iscs.render(list);
+ },
+ // 消息处理
+ stateMessage(val) {
this.$iscs && this.$iscs.setDeviceStatus(val);
},
- // 充值窗口大小
+ // 充值窗口大小
resize() {
this.$nextTick(() => {
this.$iscs && this.$iscs.resize({ width: this.width, height: this.height });
});
},
- // 销毁
+ // 销毁
destroy() {
if (this.$iscs) {
this.$iscs.destroy();
this.$iscs = null;
Vue.prototype.$iscs = null;
}
- },
+ }
}
};
diff --git a/src/views/iscs_new/iscsDraw/statusList.vue b/src/views/iscs_new/iscsDraw/statusList.vue
index 4070a99d5..d465c2a8f 100644
--- a/src/views/iscs_new/iscsDraw/statusList.vue
+++ b/src/views/iscs_new/iscsDraw/statusList.vue
@@ -66,6 +66,7 @@
编辑状态组合
删除
+ 预览
@@ -133,15 +134,16 @@
-
当前动画帧
-
当前动画帧:{{ scope.row.frameId }} -->
+ 添加帧
+
{
+ if (each.loop) {
+
+ } else {
+ const frameList = each.frameList;
+ frameList.forEach(frame=>{
+ // frame.name;
+ // frame.status;
+ // this.$iscs.
+ });
+ }
+ });
+ // this.show = false;
}
}
};
diff --git a/src/views/iscs_new/iscsPreview/index.vue b/src/views/iscs_new/iscsPreview/index.vue
index 22a2682d3..7a42be306 100644
--- a/src/views/iscs_new/iscsPreview/index.vue
+++ b/src/views/iscs_new/iscsPreview/index.vue
@@ -56,7 +56,6 @@ export default {
source.elementList.length) {
this.composeElemList = source.elementList;
this.statusTab = this.composeElemList[0].code;
- debugger;
} else {
this.composeElemList = [];
}