diff --git a/src/api/Dlink/index.js b/src/api/Dlink/index.js
index 407cbd2d06..39a6163dc6 100644
--- a/src/api/Dlink/index.js
+++ b/src/api/Dlink/index.js
@@ -22,7 +22,7 @@ export async function getDlinkJson(type = 'Topic', params) {
export async function deleteTopic(
Topic = '$dg/user/router/thing/111/cmd/delete'
) {
- console.warn(`${location.href} unSubscribe ${Topic}`)
+ // console.warn(`${location.href} unSubscribe ${Topic}`)
return {
code: 200,
msg: 'success',
diff --git a/src/store/modules/topo.js b/src/store/modules/topo.js
index 14e56bff5c..5521e21eca 100644
--- a/src/store/modules/topo.js
+++ b/src/store/modules/topo.js
@@ -215,6 +215,7 @@ const mutations = {
canvas.contextmenu.attrs.name == 'staticimage' ||
canvas.contextmenu.attrs.name == 'sprite' ||
canvas.contextmenu.attrs.name == 'vuecomponent' ||
+ canvas.contextmenu.attrs.name == 'amiscomponent' ||
canvas.contextmenu.attrs.name == 'printer'
) {
contextmenu = canvas.contextmenu
@@ -316,7 +317,8 @@ const mutations = {
thing.type == 'knovaimage' ||
thing.type == 'staticimage' ||
thing.type == 'gifimage' ||
- thing.type == 'vuecomponent'
+ thing.type == 'vuecomponent' ||
+ thing.type == 'amiscomponent'
) {
console.log('konvaimage', thing)
// state.createdEvidence = Evidence
@@ -349,6 +351,15 @@ const mutations = {
productid: thing.productid,
})
)
+ } else if (thing.type == 'amiscomponent') {
+ simpleImage = addNodeEvent(
+ _.merge(canvas.handlerArgs, {
+ type: 'createAmisComponent',
+ chart: thing.chart,
+ data: thing.data,
+ productid: thing.productid,
+ })
+ )
} else if (thing.type == 'gifimage') {
simpleImage = addNodeEvent(
_.merge(canvas.handlerArgs, {
diff --git a/src/utils/konva/common.js b/src/utils/konva/common.js
index 4fad623c4e..e6d085c10b 100644
--- a/src/utils/konva/common.js
+++ b/src/utils/konva/common.js
@@ -123,6 +123,9 @@ function addNodeEvent(args) {
case 'createVueComponent':
return topoBasic.createVueComponent(args)
break
+ case 'createAmisComponent':
+ return topoBasic.createAmisComponent(args)
+ break
case 'createHistory': // 历史数据按钮
return createHistory(thing, saleInfo, randomXy, args)
break
diff --git a/src/utils/konva/core/topoBasic.js b/src/utils/konva/core/topoBasic.js
index f85c5f30f3..2d8fc0d270 100644
--- a/src/utils/konva/core/topoBasic.js
+++ b/src/utils/konva/core/topoBasic.js
@@ -300,8 +300,8 @@ const topoBasic = {
simpleImage = new Konva.Image({
name: 'staticimage',
id: args.productid + '_staticimage' + topoId,
- x: Axis.x,
- y: Axis.y,
+ x: 100,
+ y: 100,
image: imageObj,
width: args.data.width,
height: args.data.height,
@@ -372,6 +372,35 @@ const topoBasic = {
let vueComponet = ''
const topoId = uuid(5)
+ if (args.data.src) {
+ console.log('1111111触发了', args)
+ let src = args.data.src
+ if (src.indexOf('http') < 0) {
+ console.log(' this.$FileServe', Vue.prototype.$FileServe)
+ src = Vue.prototype.$FileServe + src
+ }
+ var imageObj = new Image()
+ imageObj.src = src
+ // imageObj.onload = () => {
+ var simpleImage = new Konva.Image({
+ id: args.data.id || 'vue_component_' + topoId,
+ x: 100,
+ y: 100,
+ image: imageObj,
+ width: args.data.width,
+ height: args.data.height,
+ type: args.chart,
+ source: args.data.source,
+ name: 'vuecomponent',
+ text: args.data.text,
+ // handler: 'dblclick',
+ draggable: true,
+ })
+ simpleImage.setAttrs({
+ src: src,
+ })
+ return simpleImage
+ }
vueComponet = new Konva.Rect({
x: 100,
y: 100,
@@ -379,7 +408,7 @@ const topoBasic = {
height: args.data.height || 200,
type: args.chart,
fill: args.data.fill || 'rgba(30, 30, 30,0.7)',
- text: args.text,
+ text: args.data.text,
source: args.data.source,
name: 'vuecomponent',
id: args.data.id || 'vue_component_' + topoId,
@@ -392,6 +421,63 @@ const topoBasic = {
return vueComponet
},
+ createAmisComponent(args) {
+ console.info(
+ 'src/utils/konva/core/topoBasic.js',
+ 'gifImage',
+ // args.path,
+ args
+ )
+ if (args.data.src) {
+ let src = args.data.src
+ if (src.indexOf('http') < 0) {
+ console.log(' this.$FileServe', Vue.prototype.$FileServe)
+ src = Vue.prototype.$FileServe + src
+ }
+ var imageObj = new Image()
+ imageObj.src = src
+ // imageObj.onload = () => {
+ var simpleImage = new Konva.Image({
+ id: args.data.id || 'amis_component_' + topoId,
+ x: 100,
+ y: 100,
+ image: imageObj,
+ width: args.data.width,
+ height: args.data.height,
+ type: args.chart,
+ source: args.data.source,
+ name: 'amiscomponent',
+ text: args.data.text,
+ // handler: 'dblclick',
+ draggable: true,
+ })
+ simpleImage.setAttrs({
+ src: src,
+ })
+ return simpleImage
+ }
+ let vueComponet = ''
+ const topoId = uuid(5)
+ vueComponet = new Konva.Rect({
+ x: 100,
+ y: 100,
+ width: args.data.width || 300,
+ height: args.data.height || 200,
+ type: args.chart,
+ fill: args.data.fill || 'rgba(30, 30, 30,0.7)',
+ text: args.data.text,
+ source: args.data.source,
+ name: 'amiscomponent',
+ id: args.data.id || 'amis_component_' + topoId,
+ draggable: true,
+ })
+
+ // vueComponet.setAttrs({
+ // src: args.image,
+ // })
+
+ return vueComponet
+ },
/**
* @description 绑定组态
*/
diff --git a/src/utils/konva/core/topoStage.js b/src/utils/konva/core/topoStage.js
index a4d6def8da..fbcde9d362 100644
--- a/src/utils/konva/core/topoStage.js
+++ b/src/utils/konva/core/topoStage.js
@@ -198,8 +198,8 @@ const topoStage = {
if (node.attrs.type == 'konvaimage') {
let item = node.attrs
list.push(item)
- console.log('这是图片1111111', node)
- console.log('进行图片展示', node)
+ // console.log('这是图片1111111', node)
+ // console.log('进行图片展示', node)
if (window.location.hash.indexOf('type=device') < 0) {
let image = new Image()
node.setAttrs({
@@ -244,8 +244,9 @@ const topoStage = {
// BgimageObj.src = bgSrc
// layer.batchDraw()
// stage.batchDraw()
- }
- if (node.attrs.type == 'staticimage') {
+ // if (node.attrs.type == 'staticimage')
+ } else {
+ console.log('11111111')
let image = new Image()
node.setAttrs({
image: image,
diff --git a/src/views/CloudFunction/lowcode/components/ViewEdit.vue b/src/views/CloudFunction/lowcode/components/ViewEdit.vue
index c15f936e42..4c1c5aa97e 100644
--- a/src/views/CloudFunction/lowcode/components/ViewEdit.vue
+++ b/src/views/CloudFunction/lowcode/components/ViewEdit.vue
@@ -383,7 +383,7 @@
console.log(this.$refs.monacoCode.$refs.monacoEditor.editor.getValue())
this.$refs['form'].validate(async (valid) => {
if (valid) {
- const { title, type, key } = this.form
+ const { title, type, key, flag } = this.form
const params = {
data: JSON.parse(
this.$refs.monacoCode.$refs.monacoEditor.editor.getValue()
@@ -393,6 +393,7 @@
title,
type,
key,
+ flag,
}
if (this.type == 'add') {
const res = await postView(params)
diff --git a/src/views/CloudFunction/topo/components/TopoTabs.vue b/src/views/CloudFunction/topo/components/TopoTabs.vue
index f6af83cd5a..fae3d4df6a 100644
--- a/src/views/CloudFunction/topo/components/TopoTabs.vue
+++ b/src/views/CloudFunction/topo/components/TopoTabs.vue
@@ -22,6 +22,7 @@
@@ -73,6 +74,7 @@
@@ -274,7 +276,7 @@
数据卡片
-
开关机饼图
-
+ -->
+
+ 开关机饼图
+
+
-
告警列表
-
- -->
+
+ 告警列表
+
+
+
+
+ 设备列表
+
+
+
+ 工单列表
+
+
+
+
+
+
+ 视频监控
+
+
+
+
+
+
+ 低代码视图组件
+
+
-
+
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
{
- // console.log('轨迹坐标', res)
- // this.lineList = res.results
- // })
const loading = this.$baseColorfullLoading(0)
this.productIco = ''
this.deviceInfo = await getDevice(row.objectId)
@@ -1674,7 +1669,6 @@
// 本地mqtt 存在问题,在请求4秒后手动关闭所有loading
// await this.$subscribe(this.subtopic)
// 改为后端订阅
-
this.$dgiotBus.$on(
this.$dgiotBus.getTopicKeyBypage('dashboard'),
(res) => {
diff --git a/src/views/MultiTenant/roles/list/roles.vue b/src/views/MultiTenant/roles/list/roles.vue
index d425990848..c318a43665 100644
--- a/src/views/MultiTenant/roles/list/roles.vue
+++ b/src/views/MultiTenant/roles/list/roles.vue
@@ -449,8 +449,8 @@
editRow: {},
viewForm: {
showRow: false,
- class: 'Product',
- type: 'amis',
+ class: '',
+ type: '',
// key: this.$route.query.id,
key: '',
title: '',