From 158262993272fbc594b665e3de6183ca5a45a62a Mon Sep 17 00:00:00 2001 From: xiachao Date: Tue, 17 Dec 2024 13:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=A2=B3=E8=B6=B3=E8=BF=B9?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=EF=BC=8C=E5=8F=AA=E4=BF=9D=E7=95=99=E8=83=BD?= =?UTF-8?q?=E7=AE=A1=E4=B8=8E=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- sql/public.sql | 68593 ++++++++++++++++ 2 files changed, 68595 insertions(+), 2 deletions(-) create mode 100644 sql/public.sql diff --git a/application/src/main/resources/application.yml b/application/src/main/resources/application.yml index bc695bb..d6cc04b 100644 --- a/application/src/main/resources/application.yml +++ b/application/src/main/resources/application.yml @@ -82,14 +82,14 @@ mybatis-flex: #物管理数据源 pg-thing: type: com.zaxxer.hikari.HikariDataSource - url: jdbc:postgresql://127.0.0.1:25432/pub_guowang_v1 + url: jdbc:postgresql://127.0.0.1:25432/model driver-class-name: org.postgresql.Driver username: postgres password: sddt8888 #遥测数据数据眼 pg-tskv: type: com.zaxxer.hikari.HikariDataSource - url: jdbc:postgresql://127.0.0.1:25432/pub_guowang_v1 + url: jdbc:postgresql://127.0.0.1:25432/model driver-class-name: org.postgresql.Driver username: postgres password: sddt8888 diff --git a/sql/public.sql b/sql/public.sql new file mode 100644 index 0000000..012b4b1 --- /dev/null +++ b/sql/public.sql @@ -0,0 +1,68593 @@ +/* + Navicat Premium Data Transfer + + Source Server : 云上穿透25432 + Source Server Type : PostgreSQL + Source Server Version : 150006 (150006) + Source Host : 127.0.0.1:25432 + Source Catalog : model + Source Schema : public + + Target Server Type : PostgreSQL + Target Server Version : 150006 (150006) + File Encoding : 65001 + + Date: 17/12/2024 13:15:44 +*/ + + +-- ---------------------------- +-- Table structure for alarm_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_config"; +CREATE TABLE "public"."alarm_config" ( + "id" int8 NOT NULL, + "thing_id" int8, + "thing_code" varchar(255) COLLATE "pg_catalog"."default", + "attr_id" int8, + "attr_code" varchar(255) COLLATE "pg_catalog"."default", + "alarm_rule" varchar(255) COLLATE "pg_catalog"."default", + "alarm_val" varchar(255) COLLATE "pg_catalog"."default", + "fine_rule" varchar(255) COLLATE "pg_catalog"."default", + "fine_val" varchar(255) COLLATE "pg_catalog"."default", + "type" varchar(255) COLLATE "pg_catalog"."default", + "begin_time" varchar(255) COLLATE "pg_catalog"."default", + "end_time" varchar(255) COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "sort" int8 +) +; +COMMENT ON COLUMN "public"."alarm_config"."id" IS 'id'; +COMMENT ON COLUMN "public"."alarm_config"."thing_id" IS '物实体id'; +COMMENT ON COLUMN "public"."alarm_config"."thing_code" IS '物编码'; +COMMENT ON COLUMN "public"."alarm_config"."attr_id" IS '属性id'; +COMMENT ON COLUMN "public"."alarm_config"."attr_code" IS '属性编码'; +COMMENT ON COLUMN "public"."alarm_config"."alarm_rule" IS '告警条件 > < >= <= ='; +COMMENT ON COLUMN "public"."alarm_config"."alarm_val" IS '告警值'; +COMMENT ON COLUMN "public"."alarm_config"."fine_rule" IS '优值条件 > < >= <= ='; +COMMENT ON COLUMN "public"."alarm_config"."fine_val" IS '优值值'; +COMMENT ON COLUMN "public"."alarm_config"."type" IS '类型 1峰平谷尖 2夜间用能'; +COMMENT ON COLUMN "public"."alarm_config"."begin_time" IS '开始时间'; +COMMENT ON COLUMN "public"."alarm_config"."end_time" IS '结束时间'; +COMMENT ON COLUMN "public"."alarm_config"."remark" IS '备注'; +COMMENT ON COLUMN "public"."alarm_config"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."alarm_config"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."alarm_config"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."alarm_config"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."alarm_config"."sort" IS '1峰段用量2尖段用量3谷段用量4.平段用量'; +COMMENT ON TABLE "public"."alarm_config" IS '尖峰谷平,夜间用能告警配置表'; + +-- ---------------------------- +-- Records of alarm_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_dict +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_dict"; +CREATE TABLE "public"."alarm_dict" ( + "id" int8 NOT NULL, + "pid" int8, + "dict_type" varchar(100) COLLATE "pg_catalog"."default", + "dict_name" varchar(255) COLLATE "pg_catalog"."default", + "dict_value" varchar(255) COLLATE "pg_catalog"."default", + "sort" int4, + "remark" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_dict"."id" IS 'id'; +COMMENT ON COLUMN "public"."alarm_dict"."pid" IS '父级字典id'; +COMMENT ON COLUMN "public"."alarm_dict"."dict_type" IS '字典类型'; +COMMENT ON COLUMN "public"."alarm_dict"."dict_name" IS '字典名称'; +COMMENT ON COLUMN "public"."alarm_dict"."dict_value" IS '字典值'; +COMMENT ON COLUMN "public"."alarm_dict"."sort" IS '排序'; +COMMENT ON COLUMN "public"."alarm_dict"."remark" IS '备注'; +COMMENT ON COLUMN "public"."alarm_dict"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."alarm_dict"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."alarm_dict"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."alarm_dict"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."alarm_dict" IS '告警字典管理'; + +-- ---------------------------- +-- Records of alarm_dict +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_dispose_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_dispose_log"; +CREATE TABLE "public"."alarm_dispose_log" ( + "id" int8 NOT NULL, + "alarm_log_id" int8, + "describe" varchar COLLATE "pg_catalog"."default", + "status" varchar(5) COLLATE "pg_catalog"."default", + "images" varchar COLLATE "pg_catalog"."default", + "dispose_result" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_dispose_log"."alarm_log_id" IS '告警记录'; +COMMENT ON COLUMN "public"."alarm_dispose_log"."describe" IS '问题描述'; +COMMENT ON COLUMN "public"."alarm_dispose_log"."status" IS '处理状态'; +COMMENT ON COLUMN "public"."alarm_dispose_log"."images" IS '图片列表'; +COMMENT ON COLUMN "public"."alarm_dispose_log"."dispose_result" IS '处理结果'; +COMMENT ON TABLE "public"."alarm_dispose_log" IS '告警处理日志'; + +-- ---------------------------- +-- Records of alarm_dispose_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_rule +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_rule"; +CREATE TABLE "public"."alarm_rule" ( + "id" int8 NOT NULL, + "name" varchar(500) COLLATE "pg_catalog"."default", + "type" varchar(5) COLLATE "pg_catalog"."default", + "level" varchar(5) COLLATE "pg_catalog"."default", + "enable" bool DEFAULT true, + "condition" varchar(1000) COLLATE "pg_catalog"."default", + "content" varchar(500) COLLATE "pg_catalog"."default", + "remark" varchar(500) COLLATE "pg_catalog"."default", + "trigger_type" varchar(5) COLLATE "pg_catalog"."default", + "element_info" varchar COLLATE "pg_catalog"."default", + "repeat" bool, + "condition_name" varchar COLLATE "pg_catalog"."default", + "status" varchar(5) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_rule"."name" IS '告警名称'; +COMMENT ON COLUMN "public"."alarm_rule"."type" IS '告警类型'; +COMMENT ON COLUMN "public"."alarm_rule"."level" IS '严重程度'; +COMMENT ON COLUMN "public"."alarm_rule"."enable" IS '是否可用'; +COMMENT ON COLUMN "public"."alarm_rule"."condition" IS '触发规则'; +COMMENT ON COLUMN "public"."alarm_rule"."content" IS '告警内容'; +COMMENT ON COLUMN "public"."alarm_rule"."remark" IS '备注'; +COMMENT ON COLUMN "public"."alarm_rule"."trigger_type" IS '触发类型(job: 0、socket: 1)'; +COMMENT ON COLUMN "public"."alarm_rule"."element_info" IS '最新值'; +COMMENT ON COLUMN "public"."alarm_rule"."repeat" IS '重复告警'; +COMMENT ON COLUMN "public"."alarm_rule"."condition_name" IS '规则中文'; +COMMENT ON COLUMN "public"."alarm_rule"."status" IS '处理状态(0:待处理,1:处理中,2:已处理)'; +COMMENT ON COLUMN "public"."alarm_rule"."tenant_code" IS '所属租户'; +COMMENT ON COLUMN "public"."alarm_rule"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."alarm_rule"."dept_id" IS '部门id'; +COMMENT ON TABLE "public"."alarm_rule" IS '告警规则'; + +-- ---------------------------- +-- Records of alarm_rule +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_rule_action +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_rule_action"; +CREATE TABLE "public"."alarm_rule_action" ( + "id" int8 NOT NULL, + "rule_id" int8, + "action_type" varchar(5) COLLATE "pg_catalog"."default", + "action_id" int8, + "action_configure" varchar COLLATE "pg_catalog"."default", + "setting_id" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_rule_action"."id" IS '主键'; +COMMENT ON COLUMN "public"."alarm_rule_action"."rule_id" IS '规则主键'; +COMMENT ON COLUMN "public"."alarm_rule_action"."action_type" IS '动作类型(消息、控制...)'; +COMMENT ON COLUMN "public"."alarm_rule_action"."action_id" IS '动作主键(消息设置主键...)'; +COMMENT ON COLUMN "public"."alarm_rule_action"."action_configure" IS '动作额外配置'; +COMMENT ON COLUMN "public"."alarm_rule_action"."setting_id" IS '推送设置id'; +COMMENT ON COLUMN "public"."alarm_rule_action"."tenant_code" IS '所属租户'; +COMMENT ON COLUMN "public"."alarm_rule_action"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."alarm_rule_action"."dept_id" IS '部门id'; +COMMENT ON TABLE "public"."alarm_rule_action" IS '告警动作'; + +-- ---------------------------- +-- Records of alarm_rule_action +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_rule_entity +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_rule_entity"; +CREATE TABLE "public"."alarm_rule_entity" ( + "id" int8 NOT NULL, + "rule_id" int8 NOT NULL, + "thing_id" int8 NOT NULL, + "thing_code" varchar(100) COLLATE "pg_catalog"."default", + "entity_id" varchar(40) COLLATE "pg_catalog"."default", + "thing_attr" varchar(20) COLLATE "pg_catalog"."default", + "label" varchar(50) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_rule_entity"."id" IS '主键'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."rule_id" IS '规则主键'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_id" IS '物实体主键'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_code" IS '物编码'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."entity_id" IS '设备ID'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_attr" IS '物属性'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."label" IS 'AA/AB/AC'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."alarm_rule_entity"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."alarm_rule_entity" IS '告警设备'; + +-- ---------------------------- +-- Records of alarm_rule_entity +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_rule_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_rule_log"; +CREATE TABLE "public"."alarm_rule_log" ( + "id" int8 NOT NULL, + "rule_id" int8, + "action_id" int8, + "content" varchar COLLATE "pg_catalog"."default", + "status" varchar(5) COLLATE "pg_catalog"."default", + "alarm_time" timestamp(6), + "dispose_time" timestamp(6), + "creator" int8, + "dispose_user_id" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "alarm_type" varchar(255) COLLATE "pg_catalog"."default", + "alarm_thing_code" varchar(255) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."alarm_rule_log"."rule_id" IS '告警规则主键/发电告警规则主键'; +COMMENT ON COLUMN "public"."alarm_rule_log"."action_id" IS '动作id'; +COMMENT ON COLUMN "public"."alarm_rule_log"."content" IS '告警内容+告警规则'; +COMMENT ON COLUMN "public"."alarm_rule_log"."status" IS '处理状态'; +COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_time" IS '告警时间'; +COMMENT ON COLUMN "public"."alarm_rule_log"."dispose_time" IS '处理时间'; +COMMENT ON COLUMN "public"."alarm_rule_log"."dispose_user_id" IS '处理人'; +COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_type" IS '告警类型 1通用告警,2发电告警'; +COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_thing_code" IS '告警物编码,发电告警校验回显用'; +COMMENT ON TABLE "public"."alarm_rule_log" IS '告警日志'; + +-- ---------------------------- +-- Records of alarm_rule_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alarm_rule_setting +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alarm_rule_setting"; +CREATE TABLE "public"."alarm_rule_setting" ( + "id" int8 NOT NULL, + "setting_type" varchar(255) COLLATE "pg_catalog"."default", + "setting_ids" varchar COLLATE "pg_catalog"."default", + "action_type" varchar(255) COLLATE "pg_catalog"."default", + "action_id" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alarm_rule_setting"."id" IS '主键'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."setting_type" IS '告警选择类型'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."setting_ids" IS '告警id集合'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."action_type" IS '动作类型(消息、控制...)'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."action_id" IS '动作主键(消息设置主键...)'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."tenant_code" IS '所属租户'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."alarm_rule_setting"."dept_id" IS '部门id'; +COMMENT ON TABLE "public"."alarm_rule_setting" IS '告警规则设置'; + +-- ---------------------------- +-- Records of alarm_rule_setting +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alert_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alert_config"; +CREATE TABLE "public"."alert_config" ( + "id" int8 NOT NULL, + "filter_rule_id" int8, + "alert_name" varchar(255) COLLATE "pg_catalog"."default", + "alert_type" varchar(255) COLLATE "pg_catalog"."default", + "alert_level" varchar(255) COLLATE "pg_catalog"."default", + "alert_content" text COLLATE "pg_catalog"."default", + "repeat" bool, + "remark" varchar(255) COLLATE "pg_catalog"."default", + "begin_time" int8, + "end_time" int8, + "msg_push_id" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alert_config"."id" IS '主键'; +COMMENT ON COLUMN "public"."alert_config"."filter_rule_id" IS '过滤规则id'; +COMMENT ON COLUMN "public"."alert_config"."alert_name" IS '告警名称'; +COMMENT ON COLUMN "public"."alert_config"."alert_type" IS '告警类型'; +COMMENT ON COLUMN "public"."alert_config"."alert_level" IS '告警等级'; +COMMENT ON COLUMN "public"."alert_config"."alert_content" IS '告警内容'; +COMMENT ON COLUMN "public"."alert_config"."repeat" IS '是否可重复'; +COMMENT ON COLUMN "public"."alert_config"."remark" IS '备注'; +COMMENT ON COLUMN "public"."alert_config"."begin_time" IS '告警起始时间'; +COMMENT ON COLUMN "public"."alert_config"."end_time" IS '告警结束时间'; +COMMENT ON COLUMN "public"."alert_config"."msg_push_id" IS '消息推送设置主键'; +COMMENT ON COLUMN "public"."alert_config"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."alert_config"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."alert_config"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."alert_config"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."alert_config" IS '通用告警配置'; + +-- ---------------------------- +-- Records of alert_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alert_dispose_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alert_dispose_log"; +CREATE TABLE "public"."alert_dispose_log" ( + "id" int8 NOT NULL, + "alert_log_id" int8, + "describe" varchar COLLATE "pg_catalog"."default", + "status" varchar(25) COLLATE "pg_catalog"."default", + "images" varchar COLLATE "pg_catalog"."default", + "dispose_result" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alert_dispose_log"."alert_log_id" IS '告警记录'; +COMMENT ON COLUMN "public"."alert_dispose_log"."describe" IS '问题描述'; +COMMENT ON COLUMN "public"."alert_dispose_log"."status" IS '处理状态:0-待处理,1-处理中,2-已处理'; +COMMENT ON COLUMN "public"."alert_dispose_log"."images" IS '图片列表'; +COMMENT ON COLUMN "public"."alert_dispose_log"."dispose_result" IS '处理结果'; +COMMENT ON TABLE "public"."alert_dispose_log" IS '告警处理日志'; + +-- ---------------------------- +-- Records of alert_dispose_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for alert_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."alert_log"; +CREATE TABLE "public"."alert_log" ( + "id" int8 NOT NULL, + "config_id" int8, + "content" varchar COLLATE "pg_catalog"."default", + "status" varchar(25) COLLATE "pg_catalog"."default", + "alert_time" int8, + "dispose_time" int8, + "dispose_user_id" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."alert_log"."id" IS '主键'; +COMMENT ON COLUMN "public"."alert_log"."config_id" IS '告警配置id'; +COMMENT ON COLUMN "public"."alert_log"."content" IS '告警内容+过滤规则公式'; +COMMENT ON COLUMN "public"."alert_log"."status" IS '处理状态:0-待处理,1-处理中,2-已处理'; +COMMENT ON COLUMN "public"."alert_log"."alert_time" IS '告警时间'; +COMMENT ON COLUMN "public"."alert_log"."dispose_time" IS '处理时间'; +COMMENT ON COLUMN "public"."alert_log"."dispose_user_id" IS '处理人'; +COMMENT ON TABLE "public"."alert_log" IS '告警日志'; + +-- ---------------------------- +-- Records of alert_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for calc_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."calc_log"; +CREATE TABLE "public"."calc_log" ( + "id" int8 NOT NULL, + "calc_target_config_id" int8 NOT NULL, + "formula" varchar(255) COLLATE "pg_catalog"."default", + "source_info" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, + "status" int4 NOT NULL, + "time" int8, + "result" varchar(255) COLLATE "pg_catalog"."default", + "duration" int8, + "error_info" text COLLATE "pg_catalog"."default", + "calc_count" int4 DEFAULT 0, + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."calc_log"."id" IS '主键'; +COMMENT ON COLUMN "public"."calc_log"."calc_target_config_id" IS '计算目标物配置表id'; +COMMENT ON COLUMN "public"."calc_log"."formula" IS '计算公式'; +COMMENT ON COLUMN "public"."calc_log"."source_info" IS '计算源信息,json格式'; +COMMENT ON COLUMN "public"."calc_log"."status" IS '计算状态:1-已计算、2-未计算、3-计算异常、4-不匹配'; +COMMENT ON COLUMN "public"."calc_log"."time" IS '数据时间'; +COMMENT ON COLUMN "public"."calc_log"."result" IS '计算结果,只有已计算的记录才有值'; +COMMENT ON COLUMN "public"."calc_log"."duration" IS '计算耗时,单位ms'; +COMMENT ON COLUMN "public"."calc_log"."error_info" IS '错误信息'; +COMMENT ON COLUMN "public"."calc_log"."calc_count" IS '计算次数'; +COMMENT ON COLUMN "public"."calc_log"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."calc_log"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."calc_log"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."calc_log"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."calc_log"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."calc_log"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."calc_log"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."calc_log" IS '物计算日志表'; + +-- ---------------------------- +-- Records of calc_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for calc_source_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."calc_source_config"; +CREATE TABLE "public"."calc_source_config" ( + "id" int8 NOT NULL, + "calc_target_config_id" int8 NOT NULL, + "source_thing_name" varchar(100) COLLATE "pg_catalog"."default", + "source_thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "source_attr_name" varchar(100) COLLATE "pg_catalog"."default", + "source_attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "source_attr_alias" varchar(10) COLLATE "pg_catalog"."default", + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."calc_source_config"."id" IS '主键'; +COMMENT ON COLUMN "public"."calc_source_config"."calc_target_config_id" IS '计算目标物配置表id'; +COMMENT ON COLUMN "public"."calc_source_config"."source_thing_name" IS '源物名称'; +COMMENT ON COLUMN "public"."calc_source_config"."source_thing_code" IS '源物编码'; +COMMENT ON COLUMN "public"."calc_source_config"."source_attr_name" IS '源属性名称'; +COMMENT ON COLUMN "public"."calc_source_config"."source_attr_code" IS '源属性编码'; +COMMENT ON COLUMN "public"."calc_source_config"."source_attr_alias" IS '源属性在计算公式中的别名'; +COMMENT ON COLUMN "public"."calc_source_config"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."calc_source_config"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."calc_source_config"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."calc_source_config"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."calc_source_config"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."calc_source_config"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."calc_source_config"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."calc_source_config" IS '物计算(目标物)配置表'; + +-- ---------------------------- +-- Records of calc_source_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for calc_target_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."calc_target_config"; +CREATE TABLE "public"."calc_target_config" ( + "id" int8 NOT NULL, + "config_type" int4 NOT NULL, + "target_thing_name" varchar(100) COLLATE "pg_catalog"."default", + "target_thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "target_attr_name" varchar(100) COLLATE "pg_catalog"."default", + "target_attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "formula" varchar(255) COLLATE "pg_catalog"."default", + "formula_description" varchar(255) COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "enable" bool, + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."calc_target_config"."id" IS '主键'; +COMMENT ON COLUMN "public"."calc_target_config"."config_type" IS '配置类型:数据映射、聚合映射、指标计算、高级计算'; +COMMENT ON COLUMN "public"."calc_target_config"."target_thing_name" IS '目标物名称'; +COMMENT ON COLUMN "public"."calc_target_config"."target_thing_code" IS '目标物编码'; +COMMENT ON COLUMN "public"."calc_target_config"."target_attr_name" IS '目标属性名称'; +COMMENT ON COLUMN "public"."calc_target_config"."target_attr_code" IS '目标属性编码'; +COMMENT ON COLUMN "public"."calc_target_config"."formula" IS '计算公式'; +COMMENT ON COLUMN "public"."calc_target_config"."formula_description" IS '计算公式中文描述'; +COMMENT ON COLUMN "public"."calc_target_config"."remark" IS '备注'; +COMMENT ON COLUMN "public"."calc_target_config"."enable" IS '是否启用计算'; +COMMENT ON COLUMN "public"."calc_target_config"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."calc_target_config"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."calc_target_config"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."calc_target_config"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."calc_target_config"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."calc_target_config"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."calc_target_config"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."calc_target_config" IS '物计算(目标物)配置表'; + +-- ---------------------------- +-- Records of calc_target_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for carbon_ts_kv +-- ---------------------------- +DROP TABLE IF EXISTS "public"."carbon_ts_kv"; +CREATE TABLE "public"."carbon_ts_kv" ( + "thing_id" int8 NOT NULL, + "thing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, + "attr_key" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, + "ts" int8 NOT NULL, + "val" varchar COLLATE "pg_catalog"."default", + "day_time" date, + "create_time" int8, + "update_time" int8, + "attribute_type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL +) +; +COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_id" IS '企业设备id'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_code" IS '设备编码'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."attr_key" IS '属性编码'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."ts" IS '时间戳'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."val" IS '遥测值'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."day_time" IS '时间'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."create_time" IS '创建时间'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."update_time" IS '更新时间'; +COMMENT ON COLUMN "public"."carbon_ts_kv"."attribute_type" IS '属性类型:dd, mm, yy'; +COMMENT ON TABLE "public"."carbon_ts_kv" IS '企业遥测数据缓存'; + +-- ---------------------------- +-- Records of carbon_ts_kv +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_attacment +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_attacment"; +CREATE TABLE "public"."eq_attacment" ( + "id" int8 NOT NULL, + "thing_id" int8, + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "url" varchar(255) COLLATE "pg_catalog"."default", + "type" varchar(16) COLLATE "pg_catalog"."default", + "modular_type" varchar(16) COLLATE "pg_catalog"."default", + "name" varchar(255) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."eq_attacment"."thing_id" IS '设备id/维修id/保养id...各种外键id'; +COMMENT ON COLUMN "public"."eq_attacment"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_attacment"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_attacment"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_attacment"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_attacment"."url" IS '图片或文件url'; +COMMENT ON COLUMN "public"."eq_attacment"."type" IS '0图片,1附件'; +COMMENT ON COLUMN "public"."eq_attacment"."modular_type" IS '模块:0设备管理 1能源管理'; +COMMENT ON COLUMN "public"."eq_attacment"."name" IS '名称'; +COMMENT ON TABLE "public"."eq_attacment" IS '附件表'; + +-- ---------------------------- +-- Records of eq_attacment +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_bx +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_bx"; +CREATE TABLE "public"."eq_bx" ( + "id" int8 NOT NULL, + "fault_type" varchar(16) COLLATE "pg_catalog"."default", + "wx_team" varchar(255) COLLATE "pg_catalog"."default", + "urgent_level" varchar(16) COLLATE "pg_catalog"."default", + "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0, + "dept_id" int8, + "tenant_code" int8, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "fault_desc" varchar(512) COLLATE "pg_catalog"."default", + "eq_id" int8 NOT NULL, + "happen_date" timestamp(0), + "bx_user" varchar(255) COLLATE "pg_catalog"."default", + "bx_user_mobile" varchar(255) COLLATE "pg_catalog"."default", + "fault_level" varchar(16) COLLATE "pg_catalog"."default", + "reviewer" int8, + "wx_status" varchar(16) COLLATE "pg_catalog"."default", + "bx_no" varchar(64) COLLATE "pg_catalog"."default", + "wx_user_id" varchar(255) COLLATE "pg_catalog"."default", + "wx_level" varchar(255) COLLATE "pg_catalog"."default", + "fault_reason" varchar(255) COLLATE "pg_catalog"."default", + "repair_status" varchar(16) COLLATE "pg_catalog"."default", + "repair_time" date, + "in_wx" varchar(5) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."eq_bx"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_bx"."fault_type" IS '故障类型'; +COMMENT ON COLUMN "public"."eq_bx"."wx_team" IS '维修班组'; +COMMENT ON COLUMN "public"."eq_bx"."urgent_level" IS '紧急程度'; +COMMENT ON COLUMN "public"."eq_bx"."shutdown" IS '是否停机;0不停机 1停机,默认0'; +COMMENT ON COLUMN "public"."eq_bx"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_bx"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."eq_bx"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_bx"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_bx"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_bx"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_bx"."fault_desc" IS '故障描述'; +COMMENT ON COLUMN "public"."eq_bx"."eq_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_bx"."happen_date" IS '发生时间'; +COMMENT ON COLUMN "public"."eq_bx"."bx_user" IS '报修人'; +COMMENT ON COLUMN "public"."eq_bx"."bx_user_mobile" IS '报修人手机号'; +COMMENT ON COLUMN "public"."eq_bx"."fault_level" IS '故障等级'; +COMMENT ON COLUMN "public"."eq_bx"."reviewer" IS '审核人'; +COMMENT ON COLUMN "public"."eq_bx"."wx_status" IS '维修状态(0:未处理,1:处理中,2:完成)'; +COMMENT ON COLUMN "public"."eq_bx"."bx_no" IS '报修单号'; +COMMENT ON COLUMN "public"."eq_bx"."wx_user_id" IS '维修组的成员'; +COMMENT ON COLUMN "public"."eq_bx"."wx_level" IS '维修级别'; +COMMENT ON COLUMN "public"."eq_bx"."fault_reason" IS '故障原因'; +COMMENT ON COLUMN "public"."eq_bx"."repair_status" IS '报修状态(ACTIVE:已激活,INACTIVE:未激活)'; +COMMENT ON COLUMN "public"."eq_bx"."repair_time" IS '报修受理时间'; +COMMENT ON COLUMN "public"."eq_bx"."in_wx" IS '是否进入报修'; +COMMENT ON TABLE "public"."eq_bx" IS '设备报修'; + +-- ---------------------------- +-- Records of eq_bx +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by"; +CREATE TABLE "public"."eq_by" ( + "id" int8 NOT NULL, + "by_team" varchar(255) COLLATE "pg_catalog"."default", + "by_level" varchar(16) COLLATE "pg_catalog"."default", + "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "work_desc" varchar(512) COLLATE "pg_catalog"."default", + "eq_by_plan_id" int8 NOT NULL, + "by_status" varchar(16) COLLATE "pg_catalog"."default", + "by_no" varchar(64) COLLATE "pg_catalog"."default", + "shutdown_time" varchar(64) COLLATE "pg_catalog"."default", + "by_start_time" timestamp(6), + "by_end_time" timestamp(6), + "by_fee" varchar(255) COLLATE "pg_catalog"."default", + "by_user" varchar(255) COLLATE "pg_catalog"."default", + "by_time" varchar(255) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_by"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_by"."by_team" IS '保养班组'; +COMMENT ON COLUMN "public"."eq_by"."by_level" IS '保养级别'; +COMMENT ON COLUMN "public"."eq_by"."shutdown" IS '是否停机;0不停机 1停机,默认0'; +COMMENT ON COLUMN "public"."eq_by"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_by"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_by"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_by"."work_desc" IS '工作描述'; +COMMENT ON COLUMN "public"."eq_by"."eq_by_plan_id" IS '设备保养计划id'; +COMMENT ON COLUMN "public"."eq_by"."by_status" IS '保养状态'; +COMMENT ON COLUMN "public"."eq_by"."by_no" IS '保养单号'; +COMMENT ON COLUMN "public"."eq_by"."shutdown_time" IS '停机时长(单位分钟)'; +COMMENT ON COLUMN "public"."eq_by"."by_start_time" IS '保养开始时间'; +COMMENT ON COLUMN "public"."eq_by"."by_end_time" IS '保养结束时间'; +COMMENT ON COLUMN "public"."eq_by"."by_fee" IS '保养费用'; +COMMENT ON COLUMN "public"."eq_by"."by_user" IS '保养人员'; +COMMENT ON COLUMN "public"."eq_by"."by_time" IS '保养时长'; +COMMENT ON COLUMN "public"."eq_by"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_by"."tenant_code" IS '租户编码'; +COMMENT ON TABLE "public"."eq_by" IS '设备保养'; + +-- ---------------------------- +-- Records of eq_by +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by_detail"; +CREATE TABLE "public"."eq_by_detail" ( + "id" int8 NOT NULL, + "by_id" int8, + "name" varchar(255) COLLATE "pg_catalog"."default", + "description" varchar(255) COLLATE "pg_catalog"."default", + "bw_no" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "by_yesno" varchar(16) COLLATE "pg_catalog"."default", + "by_template_id" int8, + "by_template_detail_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_by_detail"."by_id" IS '保养id'; +COMMENT ON COLUMN "public"."eq_by_detail"."name" IS '部位名称'; +COMMENT ON COLUMN "public"."eq_by_detail"."description" IS '描述'; +COMMENT ON COLUMN "public"."eq_by_detail"."bw_no" IS '编号'; +COMMENT ON COLUMN "public"."eq_by_detail"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_by_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by_detail"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_by_detail"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_by_detail"."by_yesno" IS '是否保养,0未保养,1保养,默认1'; +COMMENT ON COLUMN "public"."eq_by_detail"."by_template_id" IS '保养模板id'; +COMMENT ON COLUMN "public"."eq_by_detail"."by_template_detail_id" IS '保养部位id'; +COMMENT ON TABLE "public"."eq_by_detail" IS '保养明细'; + +-- ---------------------------- +-- Records of eq_by_detail +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by_plan +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by_plan"; +CREATE TABLE "public"."eq_by_plan" ( + "id" int8 NOT NULL, + "by_team" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "by_status" varchar(16) COLLATE "pg_catalog"."default", + "by_no" varchar(64) COLLATE "pg_catalog"."default", + "by_plan_time" timestamp(6), + "by_level" varchar(16) COLLATE "pg_catalog"."default", + "by_user" varchar(255) COLLATE "pg_catalog"."default", + "by_desc" varchar(255) COLLATE "pg_catalog"."default", + "things_id" int8, + "by_template_id" varchar(2000) COLLATE "pg_catalog"."default", + "remind_time" varchar(64) COLLATE "pg_catalog"."default", + "plan_status" varchar(16) COLLATE "pg_catalog"."default", + "loop_type" varchar(16) COLLATE "pg_catalog"."default", + "loop_cycle" varchar(16) COLLATE "pg_catalog"."default", + "plan_end_time" timestamp(0), + "cycle_unit" varchar(20) COLLATE "pg_catalog"."default", + "remind_time_unit" varchar(20) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8, + "is_remind" varchar(16) COLLATE "pg_catalog"."default", + "group_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_by_plan"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_team" IS '保养班组'; +COMMENT ON COLUMN "public"."eq_by_plan"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_by_plan"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by_plan"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_by_plan"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_status" IS '保养状态'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_no" IS '保养单号'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_plan_time" IS '保养计划时间'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_level" IS '保养级别'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_user" IS '保养人员'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_desc" IS '保养描述'; +COMMENT ON COLUMN "public"."eq_by_plan"."things_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_by_plan"."by_template_id" IS '保养模板id(多个,隔开)'; +COMMENT ON COLUMN "public"."eq_by_plan"."remind_time" IS '提醒时间(提前多少天提醒)'; +COMMENT ON COLUMN "public"."eq_by_plan"."plan_status" IS '计划状态,是否停用0启用,1停用'; +COMMENT ON COLUMN "public"."eq_by_plan"."loop_type" IS '循环类型,0单次 1多次'; +COMMENT ON COLUMN "public"."eq_by_plan"."loop_cycle" IS '循环周期(天)'; +COMMENT ON COLUMN "public"."eq_by_plan"."plan_end_time" IS '保养计划截止时间'; +COMMENT ON COLUMN "public"."eq_by_plan"."cycle_unit" IS '循环周期单位 hour/day'; +COMMENT ON COLUMN "public"."eq_by_plan"."remind_time_unit" IS '提醒时间单位 hour/day'; +COMMENT ON COLUMN "public"."eq_by_plan"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_by_plan"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."eq_by_plan"."is_remind" IS '是否到期提醒过 0未提醒 1提醒'; +COMMENT ON COLUMN "public"."eq_by_plan"."group_id" IS '用户组id'; +COMMENT ON TABLE "public"."eq_by_plan" IS '设备保养计划'; + +-- ---------------------------- +-- Records of eq_by_plan +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by_plan_part +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by_plan_part"; +CREATE TABLE "public"."eq_by_plan_part" ( + "id" int8 NOT NULL, + "use_count" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "eq_by_plan_id" int8, + "eq_part_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_by_plan_part"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."use_count" IS '更换数量'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."eq_by_plan_id" IS '设备保养计划id'; +COMMENT ON COLUMN "public"."eq_by_plan_part"."eq_part_id" IS '设备部件id'; +COMMENT ON TABLE "public"."eq_by_plan_part" IS '保养计划部件更换'; + +-- ---------------------------- +-- Records of eq_by_plan_part +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by_template +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by_template"; +CREATE TABLE "public"."eq_by_template" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "by_tool" varchar(255) COLLATE "pg_catalog"."default", + "by_purpose" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "description" varchar(2000) COLLATE "pg_catalog"."default", + "device_type_id" int8, + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_by_template"."name" IS '保养模板'; +COMMENT ON COLUMN "public"."eq_by_template"."by_tool" IS '保养工具'; +COMMENT ON COLUMN "public"."eq_by_template"."by_purpose" IS '保养目的'; +COMMENT ON COLUMN "public"."eq_by_template"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_by_template"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by_template"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_by_template"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_by_template"."description" IS '描述'; +COMMENT ON COLUMN "public"."eq_by_template"."device_type_id" IS '设备类型id'; +COMMENT ON COLUMN "public"."eq_by_template"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_by_template"."tenant_code" IS '租户编码'; +COMMENT ON TABLE "public"."eq_by_template" IS '保养模板'; + +-- ---------------------------- +-- Records of eq_by_template +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_by_template_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_by_template_detail"; +CREATE TABLE "public"."eq_by_template_detail" ( + "id" int8 NOT NULL, + "by_template_id" int8, + "name" varchar(255) COLLATE "pg_catalog"."default", + "description" varchar(255) COLLATE "pg_catalog"."default", + "bw_no" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6) +) +; +COMMENT ON COLUMN "public"."eq_by_template_detail"."by_template_id" IS '保养模板id'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."name" IS '部位名称'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."description" IS '描述'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."bw_no" IS '编号'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_by_template_detail"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."eq_by_template_detail" IS '保养模板明细'; + +-- ---------------------------- +-- Records of eq_by_template_detail +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_check_result +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_check_result"; +CREATE TABLE "public"."eq_check_result" ( + "id" int8 NOT NULL, + "check_record_id" int8, + "type" varchar(5) COLLATE "pg_catalog"."default", + "check_result" text COLLATE "pg_catalog"."default", + "thing_id" int8, + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "check_start" timestamp(6), + "check_end" timestamp(6), + "check_status" varchar(5) COLLATE "pg_catalog"."default" DEFAULT 0, + "check_plan_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_check_result"."check_record_id" IS '巡检记录id'; +COMMENT ON COLUMN "public"."eq_check_result"."type" IS '1:巡检记录'; +COMMENT ON COLUMN "public"."eq_check_result"."check_result" IS '检查结果'; +COMMENT ON COLUMN "public"."eq_check_result"."thing_id" IS '设备物id'; +COMMENT ON COLUMN "public"."eq_check_result"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_check_result"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_check_result"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_check_result"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_check_result"."check_start" IS '巡检开始时间'; +COMMENT ON COLUMN "public"."eq_check_result"."check_end" IS '巡检结束时间'; +COMMENT ON COLUMN "public"."eq_check_result"."check_status" IS '巡检状态 0:未检(一项都没检查判定为未检) 1:已检 2:异常(设备检查项存在未检的或存在异常的判定为异常)'; +COMMENT ON COLUMN "public"."eq_check_result"."check_plan_id" IS '巡检计划id'; + +-- ---------------------------- +-- Records of eq_check_result +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_check_setting +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_check_setting"; +CREATE TABLE "public"."eq_check_setting" ( + "id" int8 NOT NULL, + "thing_id" int8, + "standard_id" int8, + "user_id" int8, + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "type" varchar(16) COLLATE "pg_catalog"."default", + "patrolcheck_plan_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_check_setting"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_check_setting"."thing_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_check_setting"."standard_id" IS '标准id'; +COMMENT ON COLUMN "public"."eq_check_setting"."user_id" IS '操作人id(弃用)'; +COMMENT ON COLUMN "public"."eq_check_setting"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_check_setting"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_check_setting"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_check_setting"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_check_setting"."type" IS '类型0点检 1巡检'; +COMMENT ON COLUMN "public"."eq_check_setting"."patrolcheck_plan_id" IS '巡检计划id'; +COMMENT ON TABLE "public"."eq_check_setting" IS '设备检查设置'; + +-- ---------------------------- +-- Records of eq_check_setting +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_check_standard +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_check_standard"; +CREATE TABLE "public"."eq_check_standard" ( + "id" int8 NOT NULL, + "group_id" int8, + "name" varchar(100) COLLATE "pg_catalog"."default", + "check_tool" varchar(255) COLLATE "pg_catalog"."default", + "check_purpose" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "tip" varchar(2000) COLLATE "pg_catalog"."default", + "device_type_id" int8, + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_check_standard"."group_id" IS '设备分类id'; +COMMENT ON COLUMN "public"."eq_check_standard"."name" IS '标准名称'; +COMMENT ON COLUMN "public"."eq_check_standard"."check_tool" IS '检查工具'; +COMMENT ON COLUMN "public"."eq_check_standard"."check_purpose" IS '检查目的'; +COMMENT ON COLUMN "public"."eq_check_standard"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_check_standard"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_check_standard"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_check_standard"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_check_standard"."tip" IS '备注'; +COMMENT ON COLUMN "public"."eq_check_standard"."device_type_id" IS '设备类型id'; +COMMENT ON COLUMN "public"."eq_check_standard"."tenant_code" IS '租户code'; +COMMENT ON TABLE "public"."eq_check_standard" IS '检查标准'; + +-- ---------------------------- +-- Records of eq_check_standard +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_check_standard_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_check_standard_detail"; +CREATE TABLE "public"."eq_check_standard_detail" ( + "id" int8 NOT NULL, + "standard_id" int8, + "name" varchar(255) COLLATE "pg_catalog"."default", + "reference_value" varchar(255) COLLATE "pg_catalog"."default", + "upper_limit" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "lower_limit" varchar(16) COLLATE "pg_catalog"."default", + "type" varchar(5) COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "data_gather" varchar(10) COLLATE "pg_catalog"."default", + "dict_code" varchar(64) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."standard_id" IS '检查标准id'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."name" IS '检查名称'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."reference_value" IS '参考值'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."upper_limit" IS '上限'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."lower_limit" IS '下限'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."type" IS '判定类型 0:上下限值判定 1:布尔类型判定 2:采集结果判定'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."remark" IS '备注'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."data_gather" IS '是否采集'; +COMMENT ON COLUMN "public"."eq_check_standard_detail"."dict_code" IS '属性编码,多个时逗号隔开'; +COMMENT ON TABLE "public"."eq_check_standard_detail" IS '检查标准明细'; + +-- ---------------------------- +-- Records of eq_check_standard_detail +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_file_delete +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_file_delete"; +CREATE TABLE "public"."eq_file_delete" ( + "id" int8 NOT NULL, + "url" varchar(255) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."eq_file_delete"."id" IS 'oss表id'; +COMMENT ON COLUMN "public"."eq_file_delete"."url" IS '文件路径'; + +-- ---------------------------- +-- Records of eq_file_delete +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_file_manage +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_file_manage"; +CREATE TABLE "public"."eq_file_manage" ( + "id" int8 NOT NULL, + "file_name" varchar(255) COLLATE "pg_catalog"."default", + "file_type" varchar(5) COLLATE "pg_catalog"."default", + "file_suffix" varchar(255) COLLATE "pg_catalog"."default", + "file_path" varchar(255) COLLATE "pg_catalog"."default", + "parent_id" int8, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "file_size" numeric(20,2), + "file_store_path" varchar(255) COLLATE "pg_catalog"."default", + "file_id_path" varchar(255) COLLATE "pg_catalog"."default", + "file_desc" varchar(255) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_file_manage"."file_name" IS '文件名'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_type" IS '文件类型 0:目录 1:文件'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_suffix" IS '文件后缀 文件类型是1的时候才有值'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_path" IS '文件路径'; +COMMENT ON COLUMN "public"."eq_file_manage"."parent_id" IS '文件父id'; +COMMENT ON COLUMN "public"."eq_file_manage"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_file_manage"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_file_manage"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_file_manage"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_size" IS '文件大小'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_store_path" IS '文件实际存储路径'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_id_path" IS '文件父级id集合'; +COMMENT ON COLUMN "public"."eq_file_manage"."file_desc" IS '文件描述'; +COMMENT ON COLUMN "public"."eq_file_manage"."tenant_code" IS '租户code'; + +-- ---------------------------- +-- Records of eq_file_manage +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_part_record +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_part_record"; +CREATE TABLE "public"."eq_part_record" ( + "id" int8 NOT NULL, + "use_count" varchar(16) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "eq_operate_id" int8, + "eq_part_id" int8, + "type" varchar(16) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_part_record"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_part_record"."use_count" IS '更换数量'; +COMMENT ON COLUMN "public"."eq_part_record"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_part_record"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_part_record"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_part_record"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_part_record"."eq_operate_id" IS '设备操作id(例如设备保养,设备维修等)'; +COMMENT ON COLUMN "public"."eq_part_record"."eq_part_id" IS '设备部件id'; +COMMENT ON COLUMN "public"."eq_part_record"."type" IS '操作类型0设备维修 1设备保养'; +COMMENT ON COLUMN "public"."eq_part_record"."dept_id" IS '企业id'; +COMMENT ON COLUMN "public"."eq_part_record"."tenant_code" IS '租户code'; +COMMENT ON TABLE "public"."eq_part_record" IS '部件使用记录'; + +-- ---------------------------- +-- Records of eq_part_record +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_patrol_check_plan +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_patrol_check_plan"; +CREATE TABLE "public"."eq_patrol_check_plan" ( + "id" int8 NOT NULL, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "name" varchar(255) COLLATE "pg_catalog"."default", + "check_cycle" int4, + "plan_start_time" timestamp(0), + "plan_end_time" timestamp(0), + "plan_status" varchar(16) COLLATE "pg_catalog"."default", + "user_id" varchar(255) COLLATE "pg_catalog"."default", + "remind_time" varchar(16) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8, + "plan_no" varchar(16) COLLATE "pg_catalog"."default", + "plan_range_param" int8, + "check_cycle_unit" varchar(20) COLLATE "pg_catalog"."default", + "check_end_time" timestamp(6), + "type" varchar(5) COLLATE "pg_catalog"."default", + "next_batch_time" timestamp(6), + "act_user_id" int8, + "act_check_time" timestamp(6), + "remark" varchar(255) COLLATE "pg_catalog"."default", + "patrol_check_plan_no" varchar(20) COLLATE "pg_catalog"."default", + "execute_plan_status" varchar(5) COLLATE "pg_catalog"."default", + "remind_time_unit" varchar(20) COLLATE "pg_catalog"."default", + "is_remind" varchar(16) COLLATE "pg_catalog"."default", + "group_id" int8 +) +; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."name" IS '巡检计划名称'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_cycle" IS '检查周期'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_start_time" IS '计划开始时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_end_time" IS '计划结束时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_status" IS '计划状态'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."user_id" IS '计划执行人'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remind_time" IS '提醒时间(计划开始时间前多少天提醒)'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."dept_id" IS '企业id'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."tenant_code" IS '租户code'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_no" IS '巡检计划编号'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_range_param" IS '执行范围设置'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_cycle_unit" IS '检查周期单位 hour/day'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_end_time" IS '截止时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."type" IS '0:单次 1:多次'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."next_batch_time" IS '下次记录批次时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."act_user_id" IS '实际巡检人'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."act_check_time" IS '实际巡检时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remark" IS '备注'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."patrol_check_plan_no" IS '巡检计划单号'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."execute_plan_status" IS '执行状态 0:待执行 1:执行中 2:已完成'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remind_time_unit" IS '提醒时间单位 hour/day'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."is_remind" IS '是否到期提醒过 0未提醒 1提醒'; +COMMENT ON COLUMN "public"."eq_patrol_check_plan"."group_id" IS '用户组id'; +COMMENT ON TABLE "public"."eq_patrol_check_plan" IS '设备巡检计划'; + +-- ---------------------------- +-- Records of eq_patrol_check_plan +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_patrol_check_record +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_patrol_check_record"; +CREATE TABLE "public"."eq_patrol_check_record" ( + "id" int8 NOT NULL, + "patrol_check_plan_id" int8, + "user_id" int8, + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "no_check_device_count" int4, + "abnormal_device_count" int4, + "check_start_time" timestamp(6), + "check_end_time" timestamp(6), + "tip" varchar(255) COLLATE "pg_catalog"."default", + "check_time" timestamp(6), + "check_plan_time" varchar(50) COLLATE "pg_catalog"."default", + "patrol_check_record_no" varchar(20) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."patrol_check_plan_id" IS '巡检计划id'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."user_id" IS '操作人id'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."no_check_device_count" IS '未检设备数'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."abnormal_device_count" IS '异常设备数'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_start_time" IS '检查开始时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_end_time" IS '检查结束时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."tip" IS '备注'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_time" IS '巡检时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_plan_time" IS '计划巡检时间'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."patrol_check_record_no" IS '巡检记录单号'; +COMMENT ON COLUMN "public"."eq_patrol_check_record"."tenant_code" IS '租户code'; +COMMENT ON TABLE "public"."eq_patrol_check_record" IS '设备巡检记录'; + +-- ---------------------------- +-- Records of eq_patrol_check_record +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_plan_record +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_plan_record"; +CREATE TABLE "public"."eq_plan_record" ( + "id" int8 NOT NULL, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "plan_start_time" timestamp(0), + "plan_end_time" timestamp(0), + "user_id" varchar(255) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8, + "plan_name" varchar(255) COLLATE "pg_catalog"."default", + "plan_id" int8, + "thing_id" int8, + "handle" varchar(16) COLLATE "pg_catalog"."default", + "type" varchar(16) COLLATE "pg_catalog"."default", + "reason" varchar(255) COLLATE "pg_catalog"."default", + "plan_no" varchar(16) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."eq_plan_record"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_plan_record"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_plan_record"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_plan_record"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_plan_record"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_plan_record"."plan_start_time" IS '计划开始时间'; +COMMENT ON COLUMN "public"."eq_plan_record"."plan_end_time" IS '计划结束时间'; +COMMENT ON COLUMN "public"."eq_plan_record"."user_id" IS '计划执行人'; +COMMENT ON COLUMN "public"."eq_plan_record"."dept_id" IS '企业id'; +COMMENT ON COLUMN "public"."eq_plan_record"."tenant_code" IS '租户code'; +COMMENT ON COLUMN "public"."eq_plan_record"."plan_name" IS '计划名称'; +COMMENT ON COLUMN "public"."eq_plan_record"."plan_id" IS '计划id'; +COMMENT ON COLUMN "public"."eq_plan_record"."thing_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_plan_record"."handle" IS '是否处理 0未处理 1已处理'; +COMMENT ON COLUMN "public"."eq_plan_record"."type" IS '计划类型 0保养 1巡检'; +COMMENT ON COLUMN "public"."eq_plan_record"."reason" IS '未执行原因'; +COMMENT ON COLUMN "public"."eq_plan_record"."plan_no" IS '计划编号'; +COMMENT ON TABLE "public"."eq_plan_record" IS '计划未执行记录'; + +-- ---------------------------- +-- Records of eq_plan_record +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_plan_remind_record +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_plan_remind_record"; +CREATE TABLE "public"."eq_plan_remind_record" ( + "id" int8 NOT NULL, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "type" varchar(16) COLLATE "pg_catalog"."default", + "no" varchar(64) COLLATE "pg_catalog"."default", + "start_time" timestamp(6), + "end_time" timestamp(6), + "user_id" varchar(255) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."type" IS '类型0保养计划 1巡检计划'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."no" IS '单号'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."start_time" IS '保养计划时间'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."end_time" IS '计划截止时间'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."user_id" IS '人员id,多个,隔开'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_plan_remind_record"."tenant_code" IS '租户编码'; +COMMENT ON TABLE "public"."eq_plan_remind_record" IS '计划到期提醒记录'; + +-- ---------------------------- +-- Records of eq_plan_remind_record +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_scrap +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_scrap"; +CREATE TABLE "public"."eq_scrap" ( + "id" int8 NOT NULL, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "eq_id" int8 NOT NULL, + "scrap_user_id" int8, + "examine_user_id" int8, + "scrap_disposal" varchar(16) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_scrap"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_scrap"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_scrap"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_scrap"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_scrap"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_scrap"."eq_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_scrap"."scrap_user_id" IS '报废人id'; +COMMENT ON COLUMN "public"."eq_scrap"."examine_user_id" IS '审核人id'; +COMMENT ON COLUMN "public"."eq_scrap"."scrap_disposal" IS '报废是否处理 0未处理 1已处理'; +COMMENT ON COLUMN "public"."eq_scrap"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_scrap"."tenant_code" IS '租户编码'; +COMMENT ON TABLE "public"."eq_scrap" IS '设备报废'; + +-- ---------------------------- +-- Records of eq_scrap +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_spot_check_plan +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_spot_check_plan"; +CREATE TABLE "public"."eq_spot_check_plan" ( + "id" int8 NOT NULL, + "thing_id" int8, + "last_check_time" timestamp(6), + "use_id" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "spot_check_no" varchar(20) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."thing_id" IS '设备thingid'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."last_check_time" IS '上次点检时间'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."use_id" IS '操作人'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."spot_check_no" IS '点检计划单号'; +COMMENT ON COLUMN "public"."eq_spot_check_plan"."tenant_code" IS '租户code'; + +-- ---------------------------- +-- Records of eq_spot_check_plan +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_spot_check_record +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_spot_check_record"; +CREATE TABLE "public"."eq_spot_check_record" ( + "id" int8 NOT NULL, + "thing_id" int8, + "standard_id" int8, + "user_id" int8, + "creator" int8, + "create_date" timestamp(6), + "updater" int8, + "update_date" timestamp(6), + "check_time" timestamp(6), + "use_time" varchar(16) COLLATE "pg_catalog"."default", + "check_result" text COLLATE "pg_catalog"."default", + "tip" varchar(255) COLLATE "pg_catalog"."default", + "spot_check_id" int8, + "spot_check_record_no" varchar(20) COLLATE "pg_catalog"."default", + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_spot_check_record"."thing_id" IS '设备id'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."standard_id" IS '标准id(弃用)'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."user_id" IS '操作人id'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."check_time" IS '点检时间'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."use_time" IS '用时(小时)'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."check_result" IS '检查结果'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."tip" IS '备注'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."spot_check_id" IS '点检计划id'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."spot_check_record_no" IS '点检记录单号'; +COMMENT ON COLUMN "public"."eq_spot_check_record"."tenant_code" IS '租户code'; +COMMENT ON TABLE "public"."eq_spot_check_record" IS '设备点检记录'; + +-- ---------------------------- +-- Records of eq_spot_check_record +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_user_group +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_user_group"; +CREATE TABLE "public"."eq_user_group" ( + "id" int8 NOT NULL, + "user_id" varchar(255) COLLATE "pg_catalog"."default", + "name" varchar(255) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_user_group"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_user_group"."user_id" IS 'usrid,多个,隔开'; +COMMENT ON COLUMN "public"."eq_user_group"."name" IS '用户组名'; +COMMENT ON COLUMN "public"."eq_user_group"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_user_group"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_user_group"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_user_group"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_user_group"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."eq_user_group"."tenant_code" IS '租户code'; + +-- ---------------------------- +-- Records of eq_user_group +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_wx +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_wx"; +CREATE TABLE "public"."eq_wx" ( + "id" int8 NOT NULL, + "fault_reason" varchar(255) COLLATE "pg_catalog"."default", + "wx_team" varchar(255) COLLATE "pg_catalog"."default", + "urgent_level" varchar(16) COLLATE "pg_catalog"."default", + "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0, + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "work_desc" varchar(512) COLLATE "pg_catalog"."default", + "eq_bx_id" int8 NOT NULL, + "wx_level" varchar(16) COLLATE "pg_catalog"."default", + "wx_status" varchar(16) COLLATE "pg_catalog"."default", + "wx_no" varchar(64) COLLATE "pg_catalog"."default", + "shutdown_time" varchar(64) COLLATE "pg_catalog"."default", + "wx_start_time" timestamp(6), + "wx_end_time" timestamp(6), + "wx_fee" varchar(255) COLLATE "pg_catalog"."default", + "wx_type" varchar(16) COLLATE "pg_catalog"."default", + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_wx"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_wx"."fault_reason" IS '故障原因'; +COMMENT ON COLUMN "public"."eq_wx"."wx_team" IS '维修班组'; +COMMENT ON COLUMN "public"."eq_wx"."urgent_level" IS '紧急程度'; +COMMENT ON COLUMN "public"."eq_wx"."shutdown" IS '是否停机;0不停机 1停机,默认0'; +COMMENT ON COLUMN "public"."eq_wx"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_wx"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_wx"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_wx"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_wx"."work_desc" IS '工作描述'; +COMMENT ON COLUMN "public"."eq_wx"."eq_bx_id" IS '设备报修id'; +COMMENT ON COLUMN "public"."eq_wx"."wx_level" IS '维修级别'; +COMMENT ON COLUMN "public"."eq_wx"."wx_status" IS '维修状态'; +COMMENT ON COLUMN "public"."eq_wx"."wx_no" IS '维修单号'; +COMMENT ON COLUMN "public"."eq_wx"."shutdown_time" IS '停机时长(单位分钟)'; +COMMENT ON COLUMN "public"."eq_wx"."wx_start_time" IS '维修开始时间'; +COMMENT ON COLUMN "public"."eq_wx"."wx_end_time" IS '维修结束时间'; +COMMENT ON COLUMN "public"."eq_wx"."wx_fee" IS '维修费用'; +COMMENT ON COLUMN "public"."eq_wx"."wx_type" IS '维修类别'; +COMMENT ON COLUMN "public"."eq_wx"."tenant_code" IS '租户编码'; +COMMENT ON TABLE "public"."eq_wx" IS '设备维修'; + +-- ---------------------------- +-- Records of eq_wx +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_wx_plan +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_wx_plan"; +CREATE TABLE "public"."eq_wx_plan" ( + "id" int8 NOT NULL, + "wx_team" varchar(255) COLLATE "pg_catalog"."default", + "urgent_level" varchar(5) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" timestamp(0), + "updater" int8, + "update_date" timestamp(0), + "work_desc" varchar(512) COLLATE "pg_catalog"."default", + "eq_bx_id" int8, + "wx_status" varchar(5) COLLATE "pg_catalog"."default", + "wx_no" varchar(64) COLLATE "pg_catalog"."default", + "wx_type" varchar(5) COLLATE "pg_catalog"."default", + "wx_user" varchar(255) COLLATE "pg_catalog"."default", + "work_time" varchar(5) COLLATE "pg_catalog"."default", + "thing_id" int8, + "fault_cause" varchar(5) COLLATE "pg_catalog"."default", + "wx_level" varchar(5) COLLATE "pg_catalog"."default", + "stop_status" varchar(5) COLLATE "pg_catalog"."default", + "stop_time" varchar(20) COLLATE "pg_catalog"."default", + "start_time" timestamp(6), + "end_time" timestamp(6), + "dept_id" int8, + "tenant_code" int8 +) +; +COMMENT ON COLUMN "public"."eq_wx_plan"."id" IS 'id'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_team" IS '维修班组'; +COMMENT ON COLUMN "public"."eq_wx_plan"."urgent_level" IS '紧急程度'; +COMMENT ON COLUMN "public"."eq_wx_plan"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."eq_wx_plan"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."eq_wx_plan"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."eq_wx_plan"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."eq_wx_plan"."work_desc" IS '描述'; +COMMENT ON COLUMN "public"."eq_wx_plan"."eq_bx_id" IS '设备报修id'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_status" IS '维修状态'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_no" IS '维修单号'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_type" IS '维修类别'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_user" IS '维修人员'; +COMMENT ON COLUMN "public"."eq_wx_plan"."work_time" IS '工作天数'; +COMMENT ON COLUMN "public"."eq_wx_plan"."thing_id" IS '设备物id'; +COMMENT ON COLUMN "public"."eq_wx_plan"."fault_cause" IS '故障原因'; +COMMENT ON COLUMN "public"."eq_wx_plan"."wx_level" IS '维修级别'; +COMMENT ON COLUMN "public"."eq_wx_plan"."stop_status" IS '是否停机 0:不停机 1:停机'; +COMMENT ON COLUMN "public"."eq_wx_plan"."stop_time" IS '停机时长'; +COMMENT ON COLUMN "public"."eq_wx_plan"."start_time" IS '开始时间'; +COMMENT ON COLUMN "public"."eq_wx_plan"."end_time" IS '结束时间'; +COMMENT ON COLUMN "public"."eq_wx_plan"."tenant_code" IS '租户code'; +COMMENT ON TABLE "public"."eq_wx_plan" IS '设备维修计划'; + +-- ---------------------------- +-- Records of eq_wx_plan +-- ---------------------------- + +-- ---------------------------- +-- Table structure for eq_wx_replacement +-- ---------------------------- +DROP TABLE IF EXISTS "public"."eq_wx_replacement"; +CREATE TABLE "public"."eq_wx_replacement" ( + "id" int8 NOT NULL, + "wx_plan_id" int8, + "thing_id" int8, + "use_count" int4 +) +; +COMMENT ON COLUMN "public"."eq_wx_replacement"."wx_plan_id" IS '维修记录(计划)id'; +COMMENT ON COLUMN "public"."eq_wx_replacement"."thing_id" IS '备件物id'; +COMMENT ON COLUMN "public"."eq_wx_replacement"."use_count" IS '使用数量'; + +-- ---------------------------- +-- Records of eq_wx_replacement +-- ---------------------------- + +-- ---------------------------- +-- Table structure for filter_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."filter_log"; +CREATE TABLE "public"."filter_log" ( + "id" int8 NOT NULL, + "filter_rule_id" int8 NOT NULL, + "formula" varchar(255) COLLATE "pg_catalog"."default", + "source_info" text COLLATE "pg_catalog"."default" NOT NULL, + "status" int4 NOT NULL, + "time" int8, + "result" bool, + "error_info" text COLLATE "pg_catalog"."default", + "calc_count" int4 DEFAULT 0, + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."filter_log"."id" IS '主键'; +COMMENT ON COLUMN "public"."filter_log"."filter_rule_id" IS '过滤规则配置表id'; +COMMENT ON COLUMN "public"."filter_log"."formula" IS '过滤条件'; +COMMENT ON COLUMN "public"."filter_log"."source_info" IS '数据信息,json格式'; +COMMENT ON COLUMN "public"."filter_log"."status" IS '计算状态:1-不匹配、2-已匹配、3-计算成功、4-计算异常、5-已通知'; +COMMENT ON COLUMN "public"."filter_log"."time" IS '数据时间'; +COMMENT ON COLUMN "public"."filter_log"."result" IS '计算结果,只有已计算的记录才有值'; +COMMENT ON COLUMN "public"."filter_log"."error_info" IS '错误信息'; +COMMENT ON COLUMN "public"."filter_log"."calc_count" IS '计算次数'; +COMMENT ON COLUMN "public"."filter_log"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."filter_log"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."filter_log"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."filter_log"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."filter_log"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."filter_log"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."filter_log"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."filter_log" IS '过滤日志表'; + +-- ---------------------------- +-- Records of filter_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for filter_rule +-- ---------------------------- +DROP TABLE IF EXISTS "public"."filter_rule"; +CREATE TABLE "public"."filter_rule" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "formula" varchar(255) COLLATE "pg_catalog"."default", + "formula_description" varchar(255) COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "enable" bool, + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."filter_rule"."id" IS '主键'; +COMMENT ON COLUMN "public"."filter_rule"."name" IS '过滤规则名称'; +COMMENT ON COLUMN "public"."filter_rule"."formula" IS '计算公式'; +COMMENT ON COLUMN "public"."filter_rule"."formula_description" IS '计算公式中文描述'; +COMMENT ON COLUMN "public"."filter_rule"."remark" IS '备注'; +COMMENT ON COLUMN "public"."filter_rule"."enable" IS '是否启用'; +COMMENT ON COLUMN "public"."filter_rule"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."filter_rule"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."filter_rule"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."filter_rule"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."filter_rule"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."filter_rule"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."filter_rule"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."filter_rule" IS '过滤规则表'; + +-- ---------------------------- +-- Records of filter_rule +-- ---------------------------- + +-- ---------------------------- +-- Table structure for filter_rule_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."filter_rule_detail"; +CREATE TABLE "public"."filter_rule_detail" ( + "id" int8 NOT NULL, + "filter_rule_id" int8 NOT NULL, + "thing_name" varchar(100) COLLATE "pg_catalog"."default", + "thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "attr_name" varchar(100) COLLATE "pg_catalog"."default", + "attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, + "attr_alias" varchar(10) COLLATE "pg_catalog"."default", + "data_type" int4, + "agg_type" varchar(10) COLLATE "pg_catalog"."default", + "agg_interval" int4, + "timeunit" varchar(20) COLLATE "pg_catalog"."default", + "tenant_code" int8 NOT NULL, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."filter_rule_detail"."id" IS '主键'; +COMMENT ON COLUMN "public"."filter_rule_detail"."filter_rule_id" IS '过滤规则id'; +COMMENT ON COLUMN "public"."filter_rule_detail"."thing_name" IS '物名称'; +COMMENT ON COLUMN "public"."filter_rule_detail"."thing_code" IS '物编码'; +COMMENT ON COLUMN "public"."filter_rule_detail"."attr_name" IS '属性名称'; +COMMENT ON COLUMN "public"."filter_rule_detail"."attr_code" IS '属性编码'; +COMMENT ON COLUMN "public"."filter_rule_detail"."attr_alias" IS '属性在计算公式中的别名'; +COMMENT ON COLUMN "public"."filter_rule_detail"."data_type" IS '数据类型:1-最新,2-最近, 3-区间'; +COMMENT ON COLUMN "public"."filter_rule_detail"."agg_type" IS '聚合类型:SUM|AVG|MAX|MIN|COUNT'; +COMMENT ON COLUMN "public"."filter_rule_detail"."agg_interval" IS '聚合时间间隔'; +COMMENT ON COLUMN "public"."filter_rule_detail"."timeunit" IS '聚合时间单位:MINUTE|HOUR|DAY|MONTH'; +COMMENT ON COLUMN "public"."filter_rule_detail"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."filter_rule_detail"."company_id" IS '企业id'; +COMMENT ON COLUMN "public"."filter_rule_detail"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."filter_rule_detail"."creator" IS '创建人'; +COMMENT ON COLUMN "public"."filter_rule_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."filter_rule_detail"."updater" IS '更新人'; +COMMENT ON COLUMN "public"."filter_rule_detail"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."filter_rule_detail" IS '过滤规则详情表'; + +-- ---------------------------- +-- Records of filter_rule_detail +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_component +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_component"; +CREATE TABLE "public"."gateway_component" ( + "id" int8 NOT NULL, + "name" varchar(100) COLLATE "pg_catalog"."default", + "type" varchar(255) COLLATE "pg_catalog"."default", + "description" varchar(500) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."gateway_component"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_component"."name" IS '组件名称'; +COMMENT ON COLUMN "public"."gateway_component"."type" IS '组件类型'; +COMMENT ON COLUMN "public"."gateway_component"."description" IS '组件描述'; +COMMENT ON TABLE "public"."gateway_component" IS '网关组件'; + +-- ---------------------------- +-- Records of gateway_component +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_component_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_component_config"; +CREATE TABLE "public"."gateway_component_config" ( + "id" int8 NOT NULL, + "cmpt_id" int8, + "cmpt_type" varchar(100) COLLATE "pg_catalog"."default", + "cmpt_cfg_name" varchar(255) COLLATE "pg_catalog"."default", + "cmpt_cfg_context" text COLLATE "pg_catalog"."default", + "max_instance_num" int4, + "active" bool, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."gateway_component_config"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_id" IS '组件id'; +COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_type" IS '组件类型'; +COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_cfg_name" IS '组件配置名称'; +COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_cfg_context" IS '组件配置内容'; +COMMENT ON COLUMN "public"."gateway_component_config"."max_instance_num" IS '最大实例运行数'; +COMMENT ON COLUMN "public"."gateway_component_config"."active" IS '是否启用'; +COMMENT ON TABLE "public"."gateway_component_config" IS '网关组件配置'; + +-- ---------------------------- +-- Records of gateway_component_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_component_config_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_component_config_detail"; +CREATE TABLE "public"."gateway_component_config_detail" ( + "id" int8 NOT NULL, + "cfg_id" int8, + "detail_context" varchar(500) COLLATE "pg_catalog"."default", + "debug" bool, + "read_write" int4, + "remark" varchar(2000) COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."cfg_id" IS '通讯配置主键'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."detail_context" IS '配置详情'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."debug" IS '是否调试'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."read_write" IS '类型(0-读; 1-写; 2-读写)'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."remark" IS '备注'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."gateway_component_config_detail"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."gateway_component_config_detail" IS '网关配置详情(数据主题、通道、寄存器地址位等)'; + +-- ---------------------------- +-- Records of gateway_component_config_detail +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_component_instance +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_component_instance"; +CREATE TABLE "public"."gateway_component_instance" ( + "id" int8 NOT NULL, + "cmpt_id" int8, + "cmpt_type" varchar(255) COLLATE "pg_catalog"."default", + "cmpt_cfg_id" int8, + "instance_ip" varchar(50) COLLATE "pg_catalog"."default", + "instance_name" varchar(100) COLLATE "pg_catalog"."default", + "instance_status" varchar(100) COLLATE "pg_catalog"."default", + "start_time" int8, + "dead_dur" int8 +) +; +COMMENT ON COLUMN "public"."gateway_component_instance"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_id" IS '组件id'; +COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_type" IS '组件类型'; +COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_cfg_id" IS '组件配置id'; +COMMENT ON COLUMN "public"."gateway_component_instance"."instance_ip" IS '实例ip'; +COMMENT ON COLUMN "public"."gateway_component_instance"."instance_name" IS '实例名称'; +COMMENT ON COLUMN "public"."gateway_component_instance"."instance_status" IS '实例状态:STARTING, WAITING, RUNNING, RESTARTING, STOP'; +COMMENT ON COLUMN "public"."gateway_component_instance"."start_time" IS '实例启动时间'; +COMMENT ON COLUMN "public"."gateway_component_instance"."dead_dur" IS '实例宕机时长'; +COMMENT ON TABLE "public"."gateway_component_instance" IS '网关组件实例'; + +-- ---------------------------- +-- Records of gateway_component_instance +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_component_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_component_log"; +CREATE TABLE "public"."gateway_component_log" ( + "id" int8 NOT NULL, + "cmpt_cfg_id" int8, + "cmpt_cfg_detail_id" int8, + "addr" varchar(255) COLLATE "pg_catalog"."default", + "input_msg" varchar COLLATE "pg_catalog"."default", + "output_msg" varchar COLLATE "pg_catalog"."default", + "error_msg" varchar COLLATE "pg_catalog"."default", + "origin" varchar(50) COLLATE "pg_catalog"."default", + "debug" bool, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."gateway_component_log"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_component_log"."cmpt_cfg_id" IS '组件配置id'; +COMMENT ON COLUMN "public"."gateway_component_log"."cmpt_cfg_detail_id" IS '组件配置详情id'; +COMMENT ON COLUMN "public"."gateway_component_log"."addr" IS '通道'; +COMMENT ON COLUMN "public"."gateway_component_log"."input_msg" IS '原始数据'; +COMMENT ON COLUMN "public"."gateway_component_log"."output_msg" IS '转换后数据'; +COMMENT ON COLUMN "public"."gateway_component_log"."error_msg" IS '错误消息'; +COMMENT ON COLUMN "public"."gateway_component_log"."origin" IS '数据来源'; +COMMENT ON COLUMN "public"."gateway_component_log"."debug" IS '是否调试模式日志'; +COMMENT ON COLUMN "public"."gateway_component_log"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."gateway_component_log"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."gateway_component_log"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."gateway_component_log"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."gateway_component_log" IS '网关组件数据接入日志'; + +-- ---------------------------- +-- Records of gateway_component_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gateway_device_control +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gateway_device_control"; +CREATE TABLE "public"."gateway_device_control" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "thing_name" varchar(50) COLLATE "pg_catalog"."default", + "thing_code" varchar(50) COLLATE "pg_catalog"."default", + "attr_name" varchar(50) COLLATE "pg_catalog"."default", + "attr_code" varchar(50) COLLATE "pg_catalog"."default", + "cmpt_type" varchar(50) COLLATE "pg_catalog"."default", + "cmpt_cfg_id" int8, + "cmpt_cfg_detail_id" int8, + "query_msg" varchar(5000) COLLATE "pg_catalog"."default", + "ctl_body" varchar COLLATE "pg_catalog"."default", + "ctl_type" varchar(5) COLLATE "pg_catalog"."default", + "ctl_json" varchar(10240) COLLATE "pg_catalog"."default", + "user_list" varchar(2550) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."gateway_device_control"."id" IS '主键'; +COMMENT ON COLUMN "public"."gateway_device_control"."name" IS '控制名称'; +COMMENT ON COLUMN "public"."gateway_device_control"."thing_name" IS '物名称'; +COMMENT ON COLUMN "public"."gateway_device_control"."thing_code" IS '物编码'; +COMMENT ON COLUMN "public"."gateway_device_control"."attr_name" IS '属性名称'; +COMMENT ON COLUMN "public"."gateway_device_control"."attr_code" IS '属性编码'; +COMMENT ON COLUMN "public"."gateway_device_control"."cmpt_cfg_id" IS '组件配置id'; +COMMENT ON COLUMN "public"."gateway_device_control"."cmpt_cfg_detail_id" IS '组件配置详情id'; +COMMENT ON COLUMN "public"."gateway_device_control"."query_msg" IS '查询参数'; +COMMENT ON COLUMN "public"."gateway_device_control"."ctl_body" IS '控制逻辑'; +COMMENT ON COLUMN "public"."gateway_device_control"."ctl_type" IS '控制类型,1图,2切换,3数值'; +COMMENT ON COLUMN "public"."gateway_device_control"."ctl_json" IS ' 控制样式json'; +COMMENT ON COLUMN "public"."gateway_device_control"."user_list" IS '用户列表,多个用户以英文逗号分割'; +COMMENT ON COLUMN "public"."gateway_device_control"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."gateway_device_control"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."gateway_device_control"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."gateway_device_control"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."gateway_device_control"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."gateway_device_control"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."gateway_device_control"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."gateway_device_control" IS '设备控制'; + +-- ---------------------------- +-- Records of gateway_device_control +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_base_class +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_base_class"; +CREATE TABLE "public"."gen_base_class" ( + "id" int8 NOT NULL, + "package_name" varchar(200) COLLATE "pg_catalog"."default", + "code" varchar(200) COLLATE "pg_catalog"."default", + "fields" varchar(200) COLLATE "pg_catalog"."default", + "remark" varchar(200) COLLATE "pg_catalog"."default", + "create_date" int8 +) +; +COMMENT ON COLUMN "public"."gen_base_class"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_base_class"."package_name" IS '基类包名'; +COMMENT ON COLUMN "public"."gen_base_class"."code" IS '基类编码'; +COMMENT ON COLUMN "public"."gen_base_class"."fields" IS '基类字段,多个用英文逗号分隔'; +COMMENT ON COLUMN "public"."gen_base_class"."remark" IS '备注'; +COMMENT ON COLUMN "public"."gen_base_class"."create_date" IS '创建时间'; +COMMENT ON TABLE "public"."gen_base_class" IS '基类管理'; + +-- ---------------------------- +-- Records of gen_base_class +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_datasource +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_datasource"; +CREATE TABLE "public"."gen_datasource" ( + "id" int8 NOT NULL, + "db_type" varchar(200) COLLATE "pg_catalog"."default", + "conn_name" varchar(200) COLLATE "pg_catalog"."default", + "conn_url" varchar(500) COLLATE "pg_catalog"."default", + "username" varchar(200) COLLATE "pg_catalog"."default", + "password" varchar(200) COLLATE "pg_catalog"."default", + "status" int4, + "create_date" int8 +) +; +COMMENT ON COLUMN "public"."gen_datasource"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_datasource"."db_type" IS '数据库类型 MySQL、Oracle、SQLServer、PostgreSQL'; +COMMENT ON COLUMN "public"."gen_datasource"."conn_name" IS '连接名'; +COMMENT ON COLUMN "public"."gen_datasource"."conn_url" IS 'URL'; +COMMENT ON COLUMN "public"."gen_datasource"."username" IS '用户名'; +COMMENT ON COLUMN "public"."gen_datasource"."password" IS '密码'; +COMMENT ON COLUMN "public"."gen_datasource"."status" IS '状态 0:启用 1:禁用'; +COMMENT ON COLUMN "public"."gen_datasource"."create_date" IS '创建时间'; +COMMENT ON TABLE "public"."gen_datasource" IS '数据源管理'; + +-- ---------------------------- +-- Records of gen_datasource +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_field_type +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_field_type"; +CREATE TABLE "public"."gen_field_type" ( + "id" int8 NOT NULL, + "column_type" varchar(200) COLLATE "pg_catalog"."default", + "attr_type" varchar(200) COLLATE "pg_catalog"."default", + "package_name" varchar(200) COLLATE "pg_catalog"."default", + "create_date" int8 +) +; +COMMENT ON COLUMN "public"."gen_field_type"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_field_type"."column_type" IS '字段类型'; +COMMENT ON COLUMN "public"."gen_field_type"."attr_type" IS '属性类型'; +COMMENT ON COLUMN "public"."gen_field_type"."package_name" IS '属性包名'; +COMMENT ON COLUMN "public"."gen_field_type"."create_date" IS '创建时间'; +COMMENT ON TABLE "public"."gen_field_type" IS '字段类型管理'; + +-- ---------------------------- +-- Records of gen_field_type +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_table_field +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_table_field"; +CREATE TABLE "public"."gen_table_field" ( + "id" int8 NOT NULL, + "table_id" int8, + "table_name" varchar(200) COLLATE "pg_catalog"."default", + "column_name" varchar(200) COLLATE "pg_catalog"."default", + "column_type" varchar(200) COLLATE "pg_catalog"."default", + "column_comment" varchar(200) COLLATE "pg_catalog"."default", + "attr_name" varchar(200) COLLATE "pg_catalog"."default", + "attr_type" varchar(200) COLLATE "pg_catalog"."default", + "package_name" varchar(200) COLLATE "pg_catalog"."default", + "is_pk" bool, + "is_required" bool, + "is_form" bool, + "is_list" bool, + "is_query" bool, + "query_type" varchar(200) COLLATE "pg_catalog"."default", + "form_type" varchar(200) COLLATE "pg_catalog"."default", + "dict_name" varchar(200) COLLATE "pg_catalog"."default", + "validator_type" varchar(200) COLLATE "pg_catalog"."default", + "sort" int4 +) +; +COMMENT ON COLUMN "public"."gen_table_field"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_table_field"."table_id" IS '表ID'; +COMMENT ON COLUMN "public"."gen_table_field"."table_name" IS '表名'; +COMMENT ON COLUMN "public"."gen_table_field"."column_name" IS '列名'; +COMMENT ON COLUMN "public"."gen_table_field"."column_type" IS '类型'; +COMMENT ON COLUMN "public"."gen_table_field"."column_comment" IS '列说明'; +COMMENT ON COLUMN "public"."gen_table_field"."attr_name" IS '属性名'; +COMMENT ON COLUMN "public"."gen_table_field"."attr_type" IS '属性类型'; +COMMENT ON COLUMN "public"."gen_table_field"."package_name" IS '属性包名'; +COMMENT ON COLUMN "public"."gen_table_field"."is_pk" IS '是否主键 0:否 1:是'; +COMMENT ON COLUMN "public"."gen_table_field"."is_required" IS '是否必填 0:否 1:是'; +COMMENT ON COLUMN "public"."gen_table_field"."is_form" IS '是否表单字段 0:否 1:是'; +COMMENT ON COLUMN "public"."gen_table_field"."is_list" IS '是否列表字段 0:否 1:是'; +COMMENT ON COLUMN "public"."gen_table_field"."is_query" IS '是否查询字段 0:否 1:是'; +COMMENT ON COLUMN "public"."gen_table_field"."query_type" IS '查询方式'; +COMMENT ON COLUMN "public"."gen_table_field"."form_type" IS '表单类型'; +COMMENT ON COLUMN "public"."gen_table_field"."dict_name" IS '字典名称'; +COMMENT ON COLUMN "public"."gen_table_field"."validator_type" IS '效验方式'; +COMMENT ON COLUMN "public"."gen_table_field"."sort" IS '排序'; +COMMENT ON TABLE "public"."gen_table_field" IS '代码生成表列'; + +-- ---------------------------- +-- Records of gen_table_field +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_table_info +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_table_info"; +CREATE TABLE "public"."gen_table_info" ( + "id" int8 NOT NULL, + "table_name" varchar(200) COLLATE "pg_catalog"."default", + "class_name" varchar(200) COLLATE "pg_catalog"."default", + "table_comment" varchar(200) COLLATE "pg_catalog"."default", + "author" varchar(200) COLLATE "pg_catalog"."default", + "email" varchar(200) COLLATE "pg_catalog"."default", + "package_name" varchar(200) COLLATE "pg_catalog"."default", + "version" varchar(200) COLLATE "pg_catalog"."default", + "backend_path" varchar(500) COLLATE "pg_catalog"."default", + "frontend_path" varchar(500) COLLATE "pg_catalog"."default", + "module_name" varchar(200) COLLATE "pg_catalog"."default", + "sub_module_name" varchar(200) COLLATE "pg_catalog"."default", + "datasource_id" int8, + "baseclass_id" int8, + "create_date" int8 +) +; +COMMENT ON COLUMN "public"."gen_table_info"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_table_info"."table_name" IS '表名'; +COMMENT ON COLUMN "public"."gen_table_info"."class_name" IS '类名'; +COMMENT ON COLUMN "public"."gen_table_info"."table_comment" IS '功能名'; +COMMENT ON COLUMN "public"."gen_table_info"."author" IS '作者'; +COMMENT ON COLUMN "public"."gen_table_info"."email" IS '邮箱'; +COMMENT ON COLUMN "public"."gen_table_info"."package_name" IS '项目包名'; +COMMENT ON COLUMN "public"."gen_table_info"."version" IS '项目版本号'; +COMMENT ON COLUMN "public"."gen_table_info"."backend_path" IS '后端生成路径'; +COMMENT ON COLUMN "public"."gen_table_info"."frontend_path" IS '前端生成路径'; +COMMENT ON COLUMN "public"."gen_table_info"."module_name" IS '模块名'; +COMMENT ON COLUMN "public"."gen_table_info"."sub_module_name" IS '子模块名'; +COMMENT ON COLUMN "public"."gen_table_info"."datasource_id" IS '数据源ID'; +COMMENT ON COLUMN "public"."gen_table_info"."baseclass_id" IS '基类ID'; +COMMENT ON COLUMN "public"."gen_table_info"."create_date" IS '创建时间'; +COMMENT ON TABLE "public"."gen_table_info" IS '代码生成表'; + +-- ---------------------------- +-- Records of gen_table_info +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_template +-- ---------------------------- +DROP TABLE IF EXISTS "public"."gen_template"; +CREATE TABLE "public"."gen_template" ( + "id" int8 NOT NULL, + "name" varchar(200) COLLATE "pg_catalog"."default", + "file_name" varchar(200) COLLATE "pg_catalog"."default", + "content" text COLLATE "pg_catalog"."default", + "path" varchar(500) COLLATE "pg_catalog"."default", + "status" int4, + "create_date" int8 +) +; +COMMENT ON COLUMN "public"."gen_template"."id" IS 'id'; +COMMENT ON COLUMN "public"."gen_template"."name" IS '名称'; +COMMENT ON COLUMN "public"."gen_template"."file_name" IS '文件名'; +COMMENT ON COLUMN "public"."gen_template"."content" IS '内容'; +COMMENT ON COLUMN "public"."gen_template"."path" IS '生成路径'; +COMMENT ON COLUMN "public"."gen_template"."status" IS '状态 0:启用 1:禁用'; +COMMENT ON COLUMN "public"."gen_template"."create_date" IS '创建时间'; +COMMENT ON TABLE "public"."gen_template" IS '模板管理'; + +-- ---------------------------- +-- Records of gen_template +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_board_manage +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_board_manage"; +CREATE TABLE "public"."iot_board_manage" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "type" varchar(255) COLLATE "pg_catalog"."default", + "thumbnail_url" text COLLATE "pg_catalog"."default", + "is_template" bool, + "remarks" varchar(10240) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "background_image" text COLLATE "pg_catalog"."default", + "preview_url" varchar(2550) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_board_manage"."id" IS '看板id主键'; +COMMENT ON COLUMN "public"."iot_board_manage"."name" IS '看板名称'; +COMMENT ON COLUMN "public"."iot_board_manage"."type" IS '看板类型'; +COMMENT ON COLUMN "public"."iot_board_manage"."thumbnail_url" IS '缩略图url'; +COMMENT ON COLUMN "public"."iot_board_manage"."is_template" IS '是否为模板'; +COMMENT ON COLUMN "public"."iot_board_manage"."remarks" IS '备注'; +COMMENT ON COLUMN "public"."iot_board_manage"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_board_manage"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_board_manage"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_board_manage"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_board_manage"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_board_manage"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_board_manage"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_board_manage"."background_image" IS '看板详情的背景图片'; +COMMENT ON COLUMN "public"."iot_board_manage"."preview_url" IS '预览url'; +COMMENT ON TABLE "public"."iot_board_manage" IS '组态看板管理'; + +-- ---------------------------- +-- Records of iot_board_manage +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_configuration_design +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_configuration_design"; +CREATE TABLE "public"."iot_configuration_design" ( + "id" int8 NOT NULL, + "board_manage_id" int8, + "width" int4, + "height" int4, + "background_image" text COLLATE "pg_catalog"."default", + "background_color" varchar(64) COLLATE "pg_catalog"."default", + "background_repeat" text COLLATE "pg_catalog"."default", + "page_name" varchar(255) COLLATE "pg_catalog"."default", + "device_ratio" varchar(255) COLLATE "pg_catalog"."default", + "background_size" varchar(32) COLLATE "pg_catalog"."default", + "picture_data" text COLLATE "pg_catalog"."default", + "api_set_ids" varchar(255) COLLATE "pg_catalog"."default", + "is_default_back_img" bool, + "board_type" varchar COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_configuration_design"."id" IS '主键id'; +COMMENT ON COLUMN "public"."iot_configuration_design"."board_manage_id" IS '组态看板id'; +COMMENT ON COLUMN "public"."iot_configuration_design"."width" IS '看板宽度'; +COMMENT ON COLUMN "public"."iot_configuration_design"."height" IS '看板高度'; +COMMENT ON COLUMN "public"."iot_configuration_design"."background_image" IS '背景图片'; +COMMENT ON COLUMN "public"."iot_configuration_design"."background_color" IS '背景颜色'; +COMMENT ON COLUMN "public"."iot_configuration_design"."background_repeat" IS 'backgroundRepeat'; +COMMENT ON COLUMN "public"."iot_configuration_design"."page_name" IS '页面名称'; +COMMENT ON COLUMN "public"."iot_configuration_design"."device_ratio" IS 'device_ratio'; +COMMENT ON COLUMN "public"."iot_configuration_design"."background_size" IS 'background_size'; +COMMENT ON COLUMN "public"."iot_configuration_design"."picture_data" IS '图数据'; +COMMENT ON COLUMN "public"."iot_configuration_design"."api_set_ids" IS '超级apiid,多个id以英文逗号,分割'; +COMMENT ON COLUMN "public"."iot_configuration_design"."is_default_back_img" IS '组态看板url'; +COMMENT ON COLUMN "public"."iot_configuration_design"."board_type" IS 'board_type'; +COMMENT ON TABLE "public"."iot_configuration_design" IS '组态设计管理'; + +-- ---------------------------- +-- Records of iot_configuration_design +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_dashboard +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_dashboard"; +CREATE TABLE "public"."iot_dashboard" ( + "id" int8 NOT NULL, + "dashboard_group_id" int8, + "svg_url" varchar(500) COLLATE "pg_catalog"."default", + "img_url" varchar(500) COLLATE "pg_catalog"."default", + "title" varchar(64) COLLATE "pg_catalog"."default", + "height" varchar(32) COLLATE "pg_catalog"."default", + "width" varchar(32) COLLATE "pg_catalog"."default", + "background_color" varchar(64) COLLATE "pg_catalog"."default", + "background_picture" varchar COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "sort" int4, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "type" varchar(5) COLLATE "pg_catalog"."default", + "scada_url" varchar(25500) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_dashboard"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_dashboard"."dashboard_group_id" IS '看板管理id'; +COMMENT ON COLUMN "public"."iot_dashboard"."svg_url" IS 'svg图片地址'; +COMMENT ON COLUMN "public"."iot_dashboard"."img_url" IS '图片地址'; +COMMENT ON COLUMN "public"."iot_dashboard"."title" IS '标题'; +COMMENT ON COLUMN "public"."iot_dashboard"."height" IS '高度'; +COMMENT ON COLUMN "public"."iot_dashboard"."width" IS '宽度'; +COMMENT ON COLUMN "public"."iot_dashboard"."background_color" IS '背景颜色'; +COMMENT ON COLUMN "public"."iot_dashboard"."background_picture" IS '背景图片'; +COMMENT ON COLUMN "public"."iot_dashboard"."remark" IS '描述'; +COMMENT ON COLUMN "public"."iot_dashboard"."sort" IS '序号'; +COMMENT ON COLUMN "public"."iot_dashboard"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_dashboard"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_dashboard"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_dashboard"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_dashboard"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_dashboard"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_dashboard"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_dashboard"."type" IS '看板类型'; +COMMENT ON COLUMN "public"."iot_dashboard"."scada_url" IS '组态看板url'; +COMMENT ON TABLE "public"."iot_dashboard" IS '看板表'; + +-- ---------------------------- +-- Records of iot_dashboard +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_dashboard_element +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_dashboard_element"; +CREATE TABLE "public"."iot_dashboard_element" ( + "id" int8 NOT NULL, + "dashboard_id" int8, + "element_id" varchar(255) COLLATE "pg_catalog"."default", + "element_name" varchar(255) COLLATE "pg_catalog"."default", + "thing_code" varchar(64) COLLATE "pg_catalog"."default", + "attr_code" varchar(64) COLLATE "pg_catalog"."default", + "configuration_data" varchar COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "unit" varchar(10) COLLATE "pg_catalog"."default", + "calculate_body" varchar COLLATE "pg_catalog"."default", + "control_config" varchar(10) COLLATE "pg_catalog"."default", + "control_style" varchar(255) COLLATE "pg_catalog"."default", + "control_device" varchar(255) COLLATE "pg_catalog"."default", + "control_device_attr" varchar(50) COLLATE "pg_catalog"."default", + "control_cmd_id" int8, + "control_permissions" varchar(5000) COLLATE "pg_catalog"."default", + "control_relation" varchar(500) COLLATE "pg_catalog"."default", + "thing_id" int8 +) +; +COMMENT ON COLUMN "public"."iot_dashboard_element"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."dashboard_id" IS '看板id'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."element_id" IS '元素id'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."element_name" IS '元素名称'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."thing_code" IS '映射物'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."attr_code" IS '映射属性'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."configuration_data" IS '配置'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."unit" IS '单位'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."calculate_body" IS '计算体'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_config" IS '控制配置,0-开启,1-关闭'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_style" IS '控制样式'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_device" IS '控制设备'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_device_attr" IS '控制设备属性'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_cmd_id" IS '控制指令'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_permissions" IS '控制权限'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."control_relation" IS '对应关系'; +COMMENT ON COLUMN "public"."iot_dashboard_element"."thing_id" IS '物实体id'; +COMMENT ON TABLE "public"."iot_dashboard_element" IS '看板元素表'; + +-- ---------------------------- +-- Records of iot_dashboard_element +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_dashboard_group +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_dashboard_group"; +CREATE TABLE "public"."iot_dashboard_group" ( + "id" int8 NOT NULL, + "name" varchar(64) COLLATE "pg_catalog"."default", + "preview_picture" varchar COLLATE "pg_catalog"."default", + "exist_menu" varchar(10) COLLATE "pg_catalog"."default", + "exist_url" varchar(10) COLLATE "pg_catalog"."default", + "multiple" varchar(10) COLLATE "pg_catalog"."default", + "slideshow" varchar(10) COLLATE "pg_catalog"."default", + "slideshow_interval" varchar(10) COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."iot_dashboard_group"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."name" IS '名称'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."preview_picture" IS '预览图'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."exist_menu" IS '是否配置菜单(0-否,1-是)'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."exist_url" IS '是否生成分享地址(0-否,1-是'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."multiple" IS '是否是多个看板(0-否,1-是)'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."slideshow" IS '是否开启轮播(0-否,1-是)'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."slideshow_interval" IS '轮播间隔'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."remark" IS '描述'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_dashboard_group"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."iot_dashboard_group" IS '看板管理表'; + +-- ---------------------------- +-- Records of iot_dashboard_group +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_dashboard_svg +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_dashboard_svg"; +CREATE TABLE "public"."iot_dashboard_svg" ( + "id" int8 NOT NULL, + "dashboard_id" int8, + "svg_xml" xml, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."id" IS '主键'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."dashboard_id" IS '看板主键'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."svg_xml" IS 'svg'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_dashboard_svg"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."iot_dashboard_svg" IS '看板svg'; + +-- ---------------------------- +-- Records of iot_dashboard_svg +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_data_entry +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_data_entry"; +CREATE TABLE "public"."iot_data_entry" ( + "id" int8 NOT NULL, + "thing_code" varchar(255) COLLATE "pg_catalog"."default", + "thing_name" varchar(255) COLLATE "pg_catalog"."default", + "attr_code" varchar(255) COLLATE "pg_catalog"."default", + "attr_name" varchar(255) COLLATE "pg_catalog"."default", + "attr_value" varchar COLLATE "pg_catalog"."default", + "ts" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8 +) +; +COMMENT ON COLUMN "public"."iot_data_entry"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_data_entry"."thing_code" IS '设备编号'; +COMMENT ON COLUMN "public"."iot_data_entry"."thing_name" IS '设备名称'; +COMMENT ON COLUMN "public"."iot_data_entry"."attr_code" IS '属性编号'; +COMMENT ON COLUMN "public"."iot_data_entry"."attr_name" IS '属性名称'; +COMMENT ON COLUMN "public"."iot_data_entry"."attr_value" IS '属性值'; +COMMENT ON COLUMN "public"."iot_data_entry"."ts" IS '数据时间'; +COMMENT ON COLUMN "public"."iot_data_entry"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_data_entry"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_data_entry"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_data_entry"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_data_entry"."tenant_code" IS '租户编码'; +COMMENT ON COLUMN "public"."iot_data_entry"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_data_entry"."dept_id" IS '部门id'; +COMMENT ON TABLE "public"."iot_data_entry" IS '数据报表'; + +-- ---------------------------- +-- Records of iot_data_entry +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_device_auto_control_config +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_device_auto_control_config"; +CREATE TABLE "public"."iot_device_auto_control_config" ( + "id" int8 NOT NULL, + "filter_rule_id" int8, + "control_id" int8, + "remark" varchar(255) COLLATE "pg_catalog"."default", + "msg_push_id" int8, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."id" IS '主键'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."filter_rule_id" IS '过滤规则id'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."control_id" IS '控制指令id,gateway_device_control表主键'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."remark" IS '备注'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."msg_push_id" IS '消息推送设置主键'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_device_auto_control_config"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."iot_device_auto_control_config" IS '设备自动控制配置'; + +-- ---------------------------- +-- Records of iot_device_auto_control_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_device_control +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_device_control"; +CREATE TABLE "public"."iot_device_control" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "thing_id" int8, + "attr_code" varchar(20) COLLATE "pg_catalog"."default", + "extend_id" int8, + "relation_id" int8, + "sup_msg" varchar(5000) COLLATE "pg_catalog"."default", + "query_msg" varchar(5000) COLLATE "pg_catalog"."default", + "ctl_body" varchar COLLATE "pg_catalog"."default", + "remark" varchar(255) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "attr_id" int8, + "ctl_type" varchar(5) COLLATE "pg_catalog"."default", + "ctl_json" varchar(10240) COLLATE "pg_catalog"."default", + "user_list" varchar(2550) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_device_control"."id" IS '主键'; +COMMENT ON COLUMN "public"."iot_device_control"."name" IS '控制名称'; +COMMENT ON COLUMN "public"."iot_device_control"."thing_id" IS '设备主键'; +COMMENT ON COLUMN "public"."iot_device_control"."attr_code" IS '属性编码'; +COMMENT ON COLUMN "public"."iot_device_control"."extend_id" IS '通讯主键'; +COMMENT ON COLUMN "public"."iot_device_control"."relation_id" IS '通讯关系主键'; +COMMENT ON COLUMN "public"."iot_device_control"."sup_msg" IS '辅助参数'; +COMMENT ON COLUMN "public"."iot_device_control"."query_msg" IS '查询参数'; +COMMENT ON COLUMN "public"."iot_device_control"."ctl_body" IS '控制逻辑'; +COMMENT ON COLUMN "public"."iot_device_control"."remark" IS '备注'; +COMMENT ON COLUMN "public"."iot_device_control"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_device_control"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_device_control"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_device_control"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_device_control"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_device_control"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_device_control"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_device_control"."attr_id" IS '属性id'; +COMMENT ON COLUMN "public"."iot_device_control"."ctl_type" IS '控制类型,1图,2切换,3数值'; +COMMENT ON COLUMN "public"."iot_device_control"."ctl_json" IS ' 控制样式json 数组json [ + * { + * "no":"123", + * "code":"a001", + * "name":"空调开", + * "url":"/dddd/eee.png" + * },{ + * "no":"124", + * "code":"a002", + * "name":"空调关", + * "url":"/dddd/ccc.png" + * } + * ]'; +COMMENT ON COLUMN "public"."iot_device_control"."user_list" IS '用户列表,多个用户以英文逗号分割'; +COMMENT ON TABLE "public"."iot_device_control" IS '设备控制'; + +-- ---------------------------- +-- Records of iot_device_control +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_device_control_log +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_device_control_log"; +CREATE TABLE "public"."iot_device_control_log" ( + "id" int8 NOT NULL, + "control_id" int8, + "in_msg" varchar COLLATE "pg_catalog"."default", + "out_msg" varchar COLLATE "pg_catalog"."default", + "error_msg" varchar COLLATE "pg_catalog"."default", + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8 +) +; +COMMENT ON COLUMN "public"."iot_device_control_log"."id" IS '主键'; +COMMENT ON COLUMN "public"."iot_device_control_log"."control_id" IS '控制主键'; +COMMENT ON COLUMN "public"."iot_device_control_log"."in_msg" IS '请求参数'; +COMMENT ON COLUMN "public"."iot_device_control_log"."out_msg" IS '输出结果'; +COMMENT ON COLUMN "public"."iot_device_control_log"."error_msg" IS '异常信息'; +COMMENT ON COLUMN "public"."iot_device_control_log"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_device_control_log"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_device_control_log"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_device_control_log"."update_date" IS '更新时间'; +COMMENT ON TABLE "public"."iot_device_control_log" IS '设备控制日志'; + +-- ---------------------------- +-- Records of iot_device_control_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_device_management +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_device_management"; +CREATE TABLE "public"."iot_device_management" ( + "id" int8 NOT NULL, + "thing_relation_id" int8, + "thing_id" int8, + "thing_code" varchar(255) COLLATE "pg_catalog"."default", + "thing_name" varchar(255) COLLATE "pg_catalog"."default", + "thing_attr_code" varchar(255) COLLATE "pg_catalog"."default", + "thing_attr_name" varchar(255) COLLATE "pg_catalog"."default", + "thing_attr_unit" varchar(255) COLLATE "pg_catalog"."default", + "sort" varchar(255) COLLATE "pg_catalog"."default", + "ctl_id" int8, + "title" varchar(255) COLLATE "pg_catalog"."default", + "img" varchar(255) COLLATE "pg_catalog"."default", + "view_type" varchar(255) COLLATE "pg_catalog"."default", + "config_type" varchar(255) COLLATE "pg_catalog"."default", + "thing_attr_boundary" varchar(255) COLLATE "pg_catalog"."default", + "time_info" varchar(255) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_device_management"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_relation_id" IS '物关系id'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_id" IS '物实体id'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_code" IS '物编码'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_name" IS '物名称'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_code" IS '物属性编码'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_name" IS '物属性名称'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_unit" IS '物属性单位'; +COMMENT ON COLUMN "public"."iot_device_management"."sort" IS '序号'; +COMMENT ON COLUMN "public"."iot_device_management"."ctl_id" IS '控制命令id'; +COMMENT ON COLUMN "public"."iot_device_management"."title" IS '属性标题/控制命令标题'; +COMMENT ON COLUMN "public"."iot_device_management"."img" IS '图标图片'; +COMMENT ON COLUMN "public"."iot_device_management"."view_type" IS '图例类型/自定义方法函数'; +COMMENT ON COLUMN "public"."iot_device_management"."config_type" IS '配置类型 1历史数据图例,2最新值图标,3控制'; +COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_boundary" IS '上下限JSON{"up":"","down":""}'; +COMMENT ON COLUMN "public"."iot_device_management"."time_info" IS '英文逗号分割,如2,3,4 表示2天3小时4分钟'; +COMMENT ON TABLE "public"."iot_device_management" IS '设备监控属性配置'; + +-- ---------------------------- +-- Records of iot_device_management +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_enterprise_dashboard +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_enterprise_dashboard"; +CREATE TABLE "public"."iot_enterprise_dashboard" ( + "id" int8 NOT NULL, + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "large_screen_name" varchar(255) COLLATE "pg_catalog"."default", + "large_screen_url" varchar(255) COLLATE "pg_catalog"."default", + "large_screen_type" varchar(255) COLLATE "pg_catalog"."default", + "detail_json" varchar(1024) COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_name" IS '大屏名称'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_url" IS '背景图片地址'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_type" IS '大屏类型: +1.只有鸟瞰图 +2.鸟瞰图-左、三张看板 +3.鸟瞰图-右、三张看板 +4.鸟瞰图、6个看板'; +COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."detail_json" IS '详情json'; +COMMENT ON TABLE "public"."iot_enterprise_dashboard" IS '企业主页配置管理'; + +-- ---------------------------- +-- Records of iot_enterprise_dashboard +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_group_info +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_group_info"; +CREATE TABLE "public"."iot_group_info" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, + "type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, + "code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, + "business_type" varchar(255) COLLATE "pg_catalog"."default", + "is_default" int2 NOT NULL DEFAULT 0, + "thumbnail_url" text COLLATE "pg_catalog"."default", + "remark" varchar(500) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "sort" int8 DEFAULT 0 +) +; +COMMENT ON COLUMN "public"."iot_group_info"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_group_info"."name" IS '组名称'; +COMMENT ON COLUMN "public"."iot_group_info"."type" IS '组类型: thing/attr/tag/relation'; +COMMENT ON COLUMN "public"."iot_group_info"."code" IS '组编码'; +COMMENT ON COLUMN "public"."iot_group_info"."business_type" IS '组业务类型'; +COMMENT ON COLUMN "public"."iot_group_info"."is_default" IS '0 默认 1.自定义'; +COMMENT ON COLUMN "public"."iot_group_info"."thumbnail_url" IS '缩略图url'; +COMMENT ON COLUMN "public"."iot_group_info"."remark" IS '备注说明'; +COMMENT ON COLUMN "public"."iot_group_info"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_group_info"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_group_info"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_group_info"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_group_info"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_group_info"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_group_info"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_group_info"."sort" IS '排序'; +COMMENT ON TABLE "public"."iot_group_info" IS '物的组信息表'; + +-- ---------------------------- +-- Records of iot_group_info +-- ---------------------------- +INSERT INTO "public"."iot_group_info" VALUES (196836405161361408, '设备组', 'thing', '001', '', 0, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1727341116035, 1067246875800000001, 1727341116035, 1); +INSERT INTO "public"."iot_group_info" VALUES (168574902469660672, '场地', 'material', '275a6f', '采石场', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603048719, 1067246875800000001, 1724230945833, 5); +INSERT INTO "public"."iot_group_info" VALUES (1764837636364570626, '设备', 'material', 'e4d1c5', '冷水主机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605056264, 1067246875800000001, 1712797360031, 1); +INSERT INTO "public"."iot_group_info" VALUES (1770690190042468353, '图标', 'material', '4cc86d', '配网结构', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1711000413796, 1067246875800000001, 1712797360091, 100); +INSERT INTO "public"."iot_group_info" VALUES (1782616454139482114, '设备', 'material', '85f724', '采暖系统', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713843856736, 1067246875800000001, 1713851523352, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836952357474306, '设备', 'material', '7acfeb', '风阀', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604893185, 1067246875800000001, 1712797360028, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935816323502081, '设备', 'material', 'a516c4', '娱乐设施', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913208453, 1067246875800000001, 1712797360098, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836573326610434, '设备', 'material', 'd4b32a', '边墙风机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604802817, 1067246875800000001, 1713851523363, 8); +INSERT INTO "public"."iot_group_info" VALUES (1764836846430326786, '设备', 'material', 'd7d777', '电加热段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604867930, 1067246875800000001, 1713851523364, 9); +INSERT INTO "public"."iot_group_info" VALUES (1764836917922238465, '设备', 'material', 'e370ac', '分集水器', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604884975, 1067246875800000001, 1713851523365, 10); +INSERT INTO "public"."iot_group_info" VALUES (1764836883239538690, '设备', 'material', '302146', '定压补水装置', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604876706, 1067246875800000001, 1712797360105, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761944527037272066, '图标', 'material', 'dafbe7', '形状', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915285249, 1067246875800000001, 1712797360101, 100); +INSERT INTO "public"."iot_group_info" VALUES (1731919483815116801, '图标', 'material', '3bf7ab', '小图标', 0, '', '', 1001, 1001, 1731546878167683074, 1067246875800000001, 1701756757106, 1067246875800000001, 1712797360104, 100); +INSERT INTO "public"."iot_group_info" VALUES (1770690727714492417, '图标', 'material', '346126', 'icon图标', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1711000541988, 1067246875800000001, 1712797360110, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764836612560130049, '设备', 'material', '983b3b', '储气罐', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604812170, 1067246875800000001, 1714095863366, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935615114350593, '设备', 'material', '63390a', '箭头', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913160481, 1067246875800000001, 1714961835027, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935345122807810, '设备', 'material', '4c4fc0', '纺织机械', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913096110, 1067246875800000001, 1712797360030, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935503361314818, '设备', 'material', '08781b', '光伏产线', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913133838, 1067246875800000001, 1713850163760, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935297928499202, '设备', 'material', '1ddbd6', '阀门', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913084858, 1067246875800000001, 1712797360065, 1); +INSERT INTO "public"."iot_group_info" VALUES (1765661868233330690, '设备', 'material', '0fc691', '物料运输', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1709801568456, 1067246875800000001, 1713851575083, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836685503270914, '设备', 'material', '874d3d', '低压柜', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604829561, 1067246875800000001, 1712797360089, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761944592246116354, '图标', 'material', '8b226e', '指示灯', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915300797, 1067246875800000001, 1713851510564, 100); +INSERT INTO "public"."iot_group_info" VALUES (1761935239581536258, '设备', 'material', 'd98c18', '传送带', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913070947, 1067246875800000001, 1712797360092, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935852579065857, '设备', 'material', '815843', '制造业', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913217097, 1067246875800000001, 1712797360095, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935460520693762, '设备', 'material', 'db8f48', '管道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913123623, 1067246875800000001, 1712797360096, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935200637423617, '设备', 'material', 'e9afca', '车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913061662, 1067246875800000001, 1712797360097, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935381554532353, '设备', 'material', '39e509', '风扇', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913104796, 1067246875800000001, 1712797360102, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935094022410241, '设备', 'material', '964d3e', '泵桶罐箱', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913036243, 1067246875800000001, 1712797324076, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935683435368449, '设备', 'material', '43b67f', '沙处理', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913176770, 1067246875800000001, 1712797324078, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935422792929281, '设备', 'material', 'ed998c', '工程机械', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913114628, 1067246875800000001, 1712797328331, 1); +INSERT INTO "public"."iot_group_info" VALUES (1782616915433230338, '设备', 'material', 'a02af2', '废气处理', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713843966718, 1067246875800000001, 1713851523356, 3); +INSERT INTO "public"."iot_group_info" VALUES (1761935534390775810, '设备', 'material', '23c1b3', '机械臂', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913141235, 1067246875800000001, 1713850623101, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836986297782274, '设备', 'material', '9a4689', '风机段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604901277, 1067246875800000001, 1712797360109, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761943954971955202, '图标', 'material', 'e7c8d6', '地图', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915148858, 1067246875800000001, 1712797360099, 100); +INSERT INTO "public"."iot_group_info" VALUES (1765659695109902337, '图标', 'material', 'b3b265', '医学', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709801050343, 1067246875800000001, 1712797324076, 100); +INSERT INTO "public"."iot_group_info" VALUES (1765659282440720385, '图标', 'material', '4140ba', '环境', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709800951955, 1067246875800000001, 1712797360107, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764837743281573889, '设备', 'material', '5e3a4a', '墙体', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605081756, 1067246875800000001, 1712797360067, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838065886466050, '设备', 'material', 'c35c28', '蒸汽锅炉', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605158670, 1067246875800000001, 1712797360069, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837668270641153, '设备', 'material', 'e5b83e', '盘管段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605063872, 1067246875800000001, 1712797360072, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838100208455681, '设备', 'material', '638a9e', '直管', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605166853, 1067246875800000001, 1712797360073, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838166121943041, '设备', 'material', '5ca48f', '转轮除湿段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605182569, 1067246875800000001, 1712797360074, 1); +INSERT INTO "public"."iot_group_info" VALUES (1782642748604551170, '设备', 'material', 'e8b7ff', '风力发电', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713850125825, 1067246875800000001, 1713851523360, 6); +INSERT INTO "public"."iot_group_info" VALUES (1765659409091923970, '图标', 'material', '543cee', '交通', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709800982151, 1067246875800000001, 1713851706536, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764837047127773185, '设备', 'material', '439b72', '变压器', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604915780, 1067246875800000001, 1713924309950, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837956096364546, '图标', 'material', '496e65', '仪表盘', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605132494, 1067246875800000001, 1713851597868, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764837703242747906, '图标', 'material', '34d68c', '其他', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605072210, 1067246875800000001, 1712797360078, 100); +INSERT INTO "public"."iot_group_info" VALUES (1761944471081062401, '图标', 'material', '285550', '行业', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915271908, 1067246875800000001, 1712797360080, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764836742793269250, '设备', 'material', '42f0a4', '电动调节阀', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604843220, 1067246875800000001, 1714096112551, 1); +INSERT INTO "public"."iot_group_info" VALUES (1782643070798401537, '设备', 'material', '6a9bc7', '核能发电', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713850202643, 1067246875800000001, 1713851523357, 4); +INSERT INTO "public"."iot_group_info" VALUES (1782646476808130562, '图标', 'material', 'efb855', '电脑按键', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713851014699, 1067246875800000001, 1713851523361, 7); +INSERT INTO "public"."iot_group_info" VALUES (1764837152476106753, '设备', 'material', 'c4f46d', '过滤段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604940897, 1067246875800000001, 1712797360022, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838135151202305, '设备', 'material', '36cb77', '直流屏', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605175185, 1067246875800000001, 1712797360025, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837813326450689, '设备', 'material', '6de139', '温度&湿度', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605098456, 1067246875800000001, 1712797360029, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837601212108802, '设备', 'material', 'bbaec8', '冷冻机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605047884, 1067246875800000001, 1714096046503, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837186315751425, '设备', 'material', 'b3875d', '过滤器-DDPD', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604948964, 1067246875800000001, 1712797360035, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837992389677058, '设备', 'material', 'd148a5', '圆管', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605141148, 1067246875800000001, 1712797360036, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837849951113218, '设备', 'material', 'ef0b3b', '吸干机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605107188, 1067246875800000001, 1712797360037, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838233922867202, '设备', 'material', 'f2e4dc', '自动加药装置', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605198734, 1067246875800000001, 1712797360038, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837082938740737, '设备', 'material', '5a4a3a', '高效送风口', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604924318, 1067246875800000001, 1712797360082, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837414716575745, '设备', 'material', '87014c', '加湿段', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605003419, 1067246875800000001, 1712797360083, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837780099174402, '设备', 'material', '8a4823', '热水锅炉', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605090533, 1067246875800000001, 1712797360086, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837117755658242, '设备', 'material', '5c7ed8', '高压柜', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604932619, 1067246875800000001, 1712797360087, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838201521868802, '图标', 'material', '0e147c', '状态', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605191009, 1067246875800000001, 1712797360020, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764837921027788801, '设备', 'material', '1e3d9c', '循环水泵', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605124134, 1067246875800000001, 1714096167196, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761944029156610049, '图标', 'material', '272b1f', '电力', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915166545, 1067246875800000001, 1712797360035, 100); +INSERT INTO "public"."iot_group_info" VALUES (1782643467344678913, '设备', 'material', '5972b3', '火力发电', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713850297187, 1067246875800000001, 1713851523354, 2); +INSERT INTO "public"."iot_group_info" VALUES (1761935644952629250, '设备', 'material', '156345', '人', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913167595, 1067246875800000001, 1712797360041, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838268035141634, '设备', 'material', '67718b', '过滤器-UD', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605206866, 1067246875800000001, 1712797360045, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761935721909719042, '设备', 'material', '21dd16', '污水处理', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913185943, 1067246875800000001, 1712797360049, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761944440395534338, '图标', 'material', '60cfae', '设备图标', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915264592, 1067246875800000001, 1712797360043, 100); +INSERT INTO "public"."iot_group_info" VALUES (1761935156601425922, '设备', 'material', 'd01f1e', '仓储物流', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913051163, 1067246875800000001, 1713851490069, 1); +INSERT INTO "public"."iot_group_info" VALUES (1782644373092044802, '设备', 'material', '542e4f', '矿山', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1713850513134, 1067246875800000001, 1713851523359, 5); +INSERT INTO "public"."iot_group_info" VALUES (1761935775756193794, '设备', 'material', 'f1b48f', '洗煤产线', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913198781, 1067246875800000001, 1712797360057, 1); +INSERT INTO "public"."iot_group_info" VALUES (1765659653343023105, '图标', 'material', '5bb541', '消防疏散标识', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709801040385, 1067246875800000001, 1712797360053, 100); +INSERT INTO "public"."iot_group_info" VALUES (1764836367205928961, '图标', 'material', '7e2f1c', '按钮', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604753674, 1067246875800000001, 1713850959791, 100); +INSERT INTO "public"."iot_group_info" VALUES (1761935576002465793, '设备', 'material', '0a0bbd', '建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708913151156, 1067246875800000001, 1713850938463, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836806668324865, '设备', 'material', '6741d6', '电动蝶阀', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604858449, 1067246875800000001, 1712797360059, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764836518943264769, '设备', 'material', '157da5', '板式换热器', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709604789851, 1067246875800000001, 1712797360060, 1); +INSERT INTO "public"."iot_group_info" VALUES (1761944400969076738, '图标', 'material', '2ded4e', '基础', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1708915255192, 1067246875800000001, 1712797360019, 100); +INSERT INTO "public"."iot_group_info" VALUES (1765659470479757314, '图标', 'material', '163f96', '食品', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709800996787, 1067246875800000001, 1712797360061, 100); +INSERT INTO "public"."iot_group_info" VALUES (1655506071210037250, '设备', 'section', '0', '管道', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (178604649820061696, '设备组', 'thing', 'D0001', '', 0, NULL, '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1722994326831, 1067246875800000001, 1722994326831, 1); +INSERT INTO "public"."iot_group_info" VALUES (170628438846083072, '符号', 'material', '251876', '交通', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092649944, 1067246875800000001, 1724038608232, 6); +INSERT INTO "public"."iot_group_info" VALUES (171431373658132480, '交通', 'material', '0504fe', '军用飞机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721284084521, 1067246875800000001, 1724132984933, 7); +INSERT INTO "public"."iot_group_info" VALUES (168556705888604160, 'IT网络', 'material', 'e9a581', '机器人', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598710316, 1067246875800000001, 1723441312121, 6); +INSERT INTO "public"."iot_group_info" VALUES (168560918844674048, '仓库', 'material', 'b13edf', '仓库动物', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720599714763, 1067246875800000001, 1723441312134, 8); +INSERT INTO "public"."iot_group_info" VALUES (183794525154705408, '设备', 'material', 'c861ef', '成品料仓', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231689534, 1067246875800000001, 1724752389274, 7); +INSERT INTO "public"."iot_group_info" VALUES (172873867553935360, '自然界', 'material', '664090', '植物', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628001866, 1067246875800000001, 1724132984943, 8); +INSERT INTO "public"."iot_group_info" VALUES (168561021198274560, '仓库', 'material', '0ddf54', '仓库路面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720599739166, 1067246875800000001, 1723519995724, 9); +INSERT INTO "public"."iot_group_info" VALUES (168575158146043904, '场地', 'material', 'f5f8f7', '土壤', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603109677, 1067246875800000001, 1724231041551, 8); +INSERT INTO "public"."iot_group_info" VALUES (168575066898960384, '场地', 'material', 'c1136b', '海洋', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603087922, 1067246875800000001, 1724231055420, 10); +INSERT INTO "public"."iot_group_info" VALUES (168575023383056384, '场地', 'material', 'e2faa2', '操场', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603077547, 1067246875800000001, 1724231026487, 7); +INSERT INTO "public"."iot_group_info" VALUES (1764837534895968258, '设备', 'material', '5bdee8', '空压机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605032072, 1067246875800000001, 1724231595471, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764837487928152066, '设备', 'material', '377788', '空调箱', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605020875, 1067246875800000001, 1724232255850, 1); +INSERT INTO "public"."iot_group_info" VALUES (1764838026162212866, '设备', 'material', 'bf5d0c', '真空泵', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605149199, 1067246875800000001, 1724232388482, 1); +INSERT INTO "public"."iot_group_info" VALUES (1655505431981330433, '设备', 'section', '0', '风机', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (168556781939724288, 'IT网络', 'material', '398d7a', '箭头线条', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598728448, 1067246875800000001, 1723441333808, 9); +INSERT INTO "public"."iot_group_info" VALUES (172872923374161920, '运动', 'material', 'f7767c', '体育设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627776756, 1067246875800000001, 1723441333819, 10); +INSERT INTO "public"."iot_group_info" VALUES (173649364864995328, '暖通空调', 'material', 'd7e54d', '暖通设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721812894833, 1067246875800000001, 1723441344060, 1); +INSERT INTO "public"."iot_group_info" VALUES (172873111601942528, '运动', 'material', '4652d6', '小型体育设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627821633, 1067246875800000001, 1723441344073, 2); +INSERT INTO "public"."iot_group_info" VALUES (170984001996066816, '航空', 'material', 'b2002c', '机场', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177422805, 1067246875800000001, 1723441344080, 3); +INSERT INTO "public"."iot_group_info" VALUES (170984123484082176, '航空', 'material', '84e209', '军用飞机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177451770, 1067246875800000001, 1723441344086, 4); +INSERT INTO "public"."iot_group_info" VALUES (1655503974590713858, '动态', 'section', '0', '交互组件', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1655502742891401217, '动态', 'section', '0', '天气组件', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1, '基础', 'section', '0', '基础图形', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1655503062153433089, '动态', 'section', '0', '数据展示', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1655502918641127425, '动态', 'section', '0', '表单控件', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995335798198272, '建筑物', 'material', '0a7b7b', '交通枢纽', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180124994, 1067246875800000001, 1723441333754, 2); +INSERT INTO "public"."iot_group_info" VALUES (168557051406979072, '办公室', 'material', '413e8f', '办公墙面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598792694, 1067246875800000001, 1723441333796, 7); +INSERT INTO "public"."iot_group_info" VALUES (170631442395566080, '符号', 'material', '58667d', '物流', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093366046, 1067246875800000001, 1724038608229, 3); +INSERT INTO "public"."iot_group_info" VALUES (170628970784493568, '符号', 'material', '9c55d0', '食品', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092776768, 1067246875800000001, 1724038608234, 8); +INSERT INTO "public"."iot_group_info" VALUES (168575118207881216, '场地', 'material', '08e984', '隧道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603100155, 1067246875800000001, 1724231009150, 6); +INSERT INTO "public"."iot_group_info" VALUES (1655506210863583233, '设备', 'section', '0', '流量计', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (168560963665006592, '仓库', 'material', 'e44292', '仓库建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720599725449, 1067246875800000001, 1723519936412, 2); +INSERT INTO "public"."iot_group_info" VALUES (170631947083583488, '工厂', 'material', '1a4e92', '建筑部件', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093486373, 1067246875800000001, 1724132984883, 2); +INSERT INTO "public"."iot_group_info" VALUES (171431410979049472, '交通', 'material', '9a24bb', '卡车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721284093419, 1067246875800000001, 1724132984954, 9); +INSERT INTO "public"."iot_group_info" VALUES (183795066870038528, '设备', 'material', 'aa4d41', '干燥机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231818689, 1067246875800000001, 1724752389252, 3); +INSERT INTO "public"."iot_group_info" VALUES (183795542487334912, '设备', 'material', '2c7534', '搅拌机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231932085, 1067246875800000001, 1724752389257, 4); +INSERT INTO "public"."iot_group_info" VALUES (172872637200994304, '医疗保健', 'material', '912e98', '医疗设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627708527, 1067246875800000001, 1724752389280, 8); +INSERT INTO "public"."iot_group_info" VALUES (1655505285457514497, '设备', 'section', '0', '电力', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1655394372066877442, '基础', 'section', '0', '常用', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1655503174044880898, '动态', 'section', '0', '图表组件', 0, '', NULL, 1001, 1001, 1001, 1067246875800000001, 1686566423481, 1067246875800000001, 1686566423481, 0); +INSERT INTO "public"."iot_group_info" VALUES (1727605753633574913, '大屏', 'section', 'b74b09', '进度条', 0, '', '', 1699972072580583425, 1699972072580583425, 1699972072580583425, 1067246875800000001, 1700728283688, 1067246875800000001, NULL, 0); +INSERT INTO "public"."iot_group_info" VALUES (168556667355533312, 'IT网络', 'material', '9b8d45', 'IT图形', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598701129, 1067246875800000001, 1723441333741, 1); +INSERT INTO "public"."iot_group_info" VALUES (168556591992279040, 'IT网络', 'material', '66e18f', 'IT设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598683161, 1067246875800000001, 1723441333761, 3); +INSERT INTO "public"."iot_group_info" VALUES (172833368910598144, '暖通空调', 'material', 'e81f87', '圆形管道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618346237, 1067246875800000001, 1723441344092, 5); +INSERT INTO "public"."iot_group_info" VALUES (170995408867168256, '建筑物', 'material', '7b0710', '街道设施', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180142415, 1067246875800000001, 1723441344097, 6); +INSERT INTO "public"."iot_group_info" VALUES (171390460630142976, '建筑物', 'material', '6b64c3', '住宅区', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721274330095, 1067246875800000001, 1723441344106, 7); +INSERT INTO "public"."iot_group_info" VALUES (170983839731027968, '航空', 'material', 'b19685', '地面支援设备', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177384118, 1067246875800000001, 1723441344112, 8); +INSERT INTO "public"."iot_group_info" VALUES (172872972149723136, '运动', 'material', 'ee5a82', '体育小型车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627788385, 1067246875800000001, 1723441344117, 9); +INSERT INTO "public"."iot_group_info" VALUES (170985926061723648, '建筑施工', 'material', 'd4574e', '管道', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177881538, 1067246875800000001, 1723441344123, 10); +INSERT INTO "public"."iot_group_info" VALUES (172873154274791424, '运动', 'material', 'f77b39', '运动场地', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627831807, 1067246875800000001, 1723441355263, 8); +INSERT INTO "public"."iot_group_info" VALUES (170628287691755520, '符号', 'material', '9b1bb9', '地点', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092613906, 1067246875800000001, 1724038608225, 1); +INSERT INTO "public"."iot_group_info" VALUES (170629010470998016, '符号', 'material', '20fa8e', '文档', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092786230, 1067246875800000001, 1724038608228, 2); +INSERT INTO "public"."iot_group_info" VALUES (170631485429125120, '符号', 'material', '8332f0', '休闲', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093376306, 1067246875800000001, 1724038608230, 4); +INSERT INTO "public"."iot_group_info" VALUES (172834426894422016, '室内', 'material', '5d6b6f', '墙面地面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618598480, 1067246875800000001, 1724038608231, 5); +INSERT INTO "public"."iot_group_info" VALUES (170628513706020864, '符号', 'material', 'ae2f78', '禁止', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092667792, 1067246875800000001, 1724038608233, 7); +INSERT INTO "public"."iot_group_info" VALUES (170628189205303296, '符号', 'material', '52c0da', '标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092590425, 1067246875800000001, 1724038608235, 9); +INSERT INTO "public"."iot_group_info" VALUES (168574567411879936, '仓库', 'material', '04acc4', '仓库墙面地面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720602968835, 1067246875800000001, 1723519914599, 1); +INSERT INTO "public"."iot_group_info" VALUES (168575195374686208, '场地', 'material', 'fb9288', '屋顶', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603118553, 1067246875800000001, 1724230991917, 5); +INSERT INTO "public"."iot_group_info" VALUES (183795462346768384, '设备', 'material', 'bb5b61', '挤出机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231912978, 1067246875800000001, 1724752389287, 9); +INSERT INTO "public"."iot_group_info" VALUES (183795679079038976, '设备', 'material', 'ac8f7a', '密炼机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231964651, 1067246875800000001, 1724752389246, 2); +INSERT INTO "public"."iot_group_info" VALUES (183795800470585344, '设备', 'material', '8fb509', '双阶挤出机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724231993593, 1067246875800000001, 1724752389263, 5); +INSERT INTO "public"."iot_group_info" VALUES (170635703519023104, '海运', 'material', '850dc4', '海事人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094381977, 1067246875800000001, 1724132987527, 1); +INSERT INTO "public"."iot_group_info" VALUES (172865077274218496, '物流', 'material', '9b19b3', '轨道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625906100, 1067246875800000001, 1724132987545, 2); +INSERT INTO "public"."iot_group_info" VALUES (170628587425107968, '符号', 'material', '32151d', '社交符号', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092685368, 1067246875800000001, 1724132987555, 3); +INSERT INTO "public"."iot_group_info" VALUES (172834520712613888, '室内', 'material', '92cfeb', '室内人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618620848, 1067246875800000001, 1724132987564, 4); +INSERT INTO "public"."iot_group_info" VALUES (171436773916807168, '交通', 'material', '9558ec', '农用车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285372043, 1067246875800000001, 1724132987574, 5); +INSERT INTO "public"."iot_group_info" VALUES (170628393111392256, '符号', 'material', '836585', '动物', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092639040, 1067246875800000001, 1724132987583, 6); +INSERT INTO "public"."iot_group_info" VALUES (170983612047429632, '海运', 'material', 'd64459', '小船', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177329834, 1067246875800000001, 1724038608237, 10); +INSERT INTO "public"."iot_group_info" VALUES (170635888525578240, '海运', 'material', 'ccd1d9', '集装箱起重机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094426086, 1067246875800000001, 1724132987592, 7); +INSERT INTO "public"."iot_group_info" VALUES (170631900883324928, '工厂', 'material', 'd023d0', '管状建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093475358, 1067246875800000001, 1724132989455, 8); +INSERT INTO "public"."iot_group_info" VALUES (170744044064870400, '海运', 'material', '38c461', '木船', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721120212376, 1067246875800000001, 1724132987602, 8); +INSERT INTO "public"."iot_group_info" VALUES (170627623460802560, '电力资源', 'material', 'ede049', '加油站', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092455541, 1067246875800000001, 1724230653380, 9); +INSERT INTO "public"."iot_group_info" VALUES (170627047100518400, '城市设施', 'material', '8a6b66', '路面标志', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092318126, 1067246875800000001, 1724230766315, 2); +INSERT INTO "public"."iot_group_info" VALUES (170635759894663168, '海运', 'material', '6a9fb2', '货船', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094395418, 1067246875800000001, 1724132987612, 9); +INSERT INTO "public"."iot_group_info" VALUES (170631994294669312, '工厂', 'material', '6cb493', '污水站', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093497629, 1067246875800000001, 1724132989464, 9); +INSERT INTO "public"."iot_group_info" VALUES (170631532656988160, '符号', 'material', '7f6abe', '自然界', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093387566, 1067246875800000001, 1724132987622, 10); +INSERT INTO "public"."iot_group_info" VALUES (170631752497238016, '工厂', 'material', '690075', '工厂建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093439980, 1067246875800000001, 1724132989396, 2); +INSERT INTO "public"."iot_group_info" VALUES (170631794293477376, '工厂', 'material', '8e1d64', '工厂内部', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093449945, 1067246875800000001, 1724132984810, 1); +INSERT INTO "public"."iot_group_info" VALUES (170983663331184640, '海运', 'material', '93af23', '医疗船', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177342061, 1067246875800000001, 1724132984894, 3); +INSERT INTO "public"."iot_group_info" VALUES (170627802071044096, '冬季', 'material', '2de4fd', '冬季', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092498125, 1067246875800000001, 1724230720098, 5); +INSERT INTO "public"."iot_group_info" VALUES (170627678376824832, '电力资源', 'material', '0768b9', '绿色能源', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092468634, 1067246875800000001, 1724230584632, 4); +INSERT INTO "public"."iot_group_info" VALUES (170635382268891136, '海运', 'material', '5dc8a6', '船用起重机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094305385, 1067246875800000001, 1724132984904, 4); +INSERT INTO "public"."iot_group_info" VALUES (170635641707565056, '海运', 'material', '5ddcd3', '港口起重机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094367240, 1067246875800000001, 1724132984914, 5); +INSERT INTO "public"."iot_group_info" VALUES (170635470697402368, '海运', 'material', 'a67e71', '浮标', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094326468, 1067246875800000001, 1724132984923, 6); +INSERT INTO "public"."iot_group_info" VALUES (170635540914245632, '海运', 'material', '0fd4a7', '港口建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721094343209, 1067246875800000001, 1724132984963, 10); +INSERT INTO "public"."iot_group_info" VALUES (170627473241804800, '电力资源', 'material', 'e76fe8', '电力人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092419726, 1067246875800000001, 1724230638514, 8); +INSERT INTO "public"."iot_group_info" VALUES (170627578539806720, '电力资源', 'material', '0d82b3', '发电厂', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092444831, 1067246875800000001, 1724230569443, 3); +INSERT INTO "public"."iot_group_info" VALUES (170631637447479296, '工厂', 'material', 'e0b95e', '工厂标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721093412551, 1067246875800000001, 1724132989446, 7); +INSERT INTO "public"."iot_group_info" VALUES (1764837571025702914, '设备', 'material', '1b1538', '冷干机', 0, '', '', 1001, 1001, 1760475860978110465, 1067246875800000001, 1709605040687, 1067246875800000001, 1724232321047, 1); +INSERT INTO "public"."iot_group_info" VALUES (170983953786736640, '航空', 'material', '6da201', '货运飞机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177411311, 1067246875800000001, 1724752389234, 1); +INSERT INTO "public"."iot_group_info" VALUES (172872586626076672, '医疗保健', 'material', 'e05571', '医疗人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627696469, 1067246875800000001, 1724752389268, 6); +INSERT INTO "public"."iot_group_info" VALUES (168557187751219200, '办公室', 'material', '47ca11', '看板屏幕', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598825201, 1067246875800000001, 1724752389293, 10); +INSERT INTO "public"."iot_group_info" VALUES (168574499778727936, '仓库', 'material', 'a9d848', '仓库内部', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720602952710, 1067246875800000001, 1723519954964, 3); +INSERT INTO "public"."iot_group_info" VALUES (171390685461614592, '交通', 'material', 'b5d6f6', '飞机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721274383699, 1067246875800000001, 1724752394127, 2); +INSERT INTO "public"."iot_group_info" VALUES (183796054733488128, '设备', 'material', '5c802d', '振动筛', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724232054214, 1067246875800000001, 1724752394133, 3); +INSERT INTO "public"."iot_group_info" VALUES (170996681049903104, '建筑物', 'material', 'b60c1a', '门窗', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180445727, 1067246875800000001, 1724752394138, 4); +INSERT INTO "public"."iot_group_info" VALUES (172874003881398272, '人类', 'material', '4c87b3', '冬季人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628034369, 1067246875800000001, 1724752394144, 5); +INSERT INTO "public"."iot_group_info" VALUES (172865553545826304, '物流', 'material', '0e43a2', '物流人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721626019652, 1067246875800000001, 1724752394150, 6); +INSERT INTO "public"."iot_group_info" VALUES (172872761339809792, '运动', 'material', '4d33d8', '体育场', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627738124, 1067246875800000001, 1724752394155, 7); +INSERT INTO "public"."iot_group_info" VALUES (183795873707327488, '设备', 'material', '36bd72', '双阶密炼机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1724232011054, 1067246875800000001, 1724752394161, 8); +INSERT INTO "public"."iot_group_info" VALUES (170984187954728960, '航空', 'material', '9be1fa', '民用飞机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177467141, 1067246875800000001, 1724752394167, 9); +INSERT INTO "public"."iot_group_info" VALUES (168556821743669248, 'IT网络', 'material', '763df2', '卫星', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598737939, 1067246875800000001, 1724132989377, 1); +INSERT INTO "public"."iot_group_info" VALUES (172873965167972352, '人类', 'material', '80d999', '电力人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628025140, 1067246875800000001, 1724132989409, 3); +INSERT INTO "public"."iot_group_info" VALUES (168557136702345216, '办公室', 'material', 'e4eedf', '办公设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598813030, 1067246875800000001, 1724132989419, 4); +INSERT INTO "public"."iot_group_info" VALUES (172834663058903040, '室内', 'material', '447bf6', '浴室', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618654786, 1067246875800000001, 1724132989429, 5); +INSERT INTO "public"."iot_group_info" VALUES (170983717756473344, '海运', 'material', '79ab01', '游艇', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177355037, 1067246875800000001, 1724132989438, 6); +INSERT INTO "public"."iot_group_info" VALUES (170986199316434944, '建筑施工', 'material', '202135', '施工人员', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177946687, 1067246875800000001, 1724132989474, 10); +INSERT INTO "public"."iot_group_info" VALUES (171390407995822080, '建筑物', 'material', 'b61de7', '旋转的', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721274317546, 1067246875800000001, 1721812390473, 0); +INSERT INTO "public"."iot_group_info" VALUES (170986128336228352, '建筑施工', 'material', 'a928fb', '露天矿', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177929764, 1067246875800000001, 1723195833698, 0); +INSERT INTO "public"."iot_group_info" VALUES (171390502879367168, '建筑物', 'material', 'f55b2e', '著名的', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721274340168, 1067246875800000001, 1724752394117, 1); +INSERT INTO "public"."iot_group_info" VALUES (171430930030792704, '交通', 'material', '04c184', '急诊救护', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721283978752, 1067246875800000001, 1724229959546, 0); +INSERT INTO "public"."iot_group_info" VALUES (171452864575574016, '路面', 'material', 'd2efcd', '关卡障碍', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289208355, 1067246875800000001, 1724752394173, 10); +INSERT INTO "public"."iot_group_info" VALUES (171436868120875008, '交通', 'material', '4a226c', '起重机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285394503, 1067246875800000001, 1724059706192, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995290327748608, '建筑物', 'material', '41061d', '急诊中心', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180114153, 1067246875800000001, 1721812200750, 0); +INSERT INTO "public"."iot_group_info" VALUES (171436816711290880, '交通', 'material', 'a8ead1', '其他设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285382246, 1067246875800000001, 1724059687929, 0); +INSERT INTO "public"."iot_group_info" VALUES (170986002079289344, '建筑施工', 'material', 'bc6d5d', '混凝土工厂', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177899662, 1067246875800000001, 1723195794421, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833789507014656, '生产制造', 'material', '37e7b7', '生产传送带', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618446515, 1067246875800000001, 1724230248899, 0); +INSERT INTO "public"."iot_group_info" VALUES (171438427990921216, '路面', 'material', '55782e', '地面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285766405, 1067246875800000001, 1721812507998, 0); +INSERT INTO "public"."iot_group_info" VALUES (171452991591682048, '路面', 'material', '48a799', '交通灯', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289238638, 1067246875800000001, 1721812589847, 0); +INSERT INTO "public"."iot_group_info" VALUES (171431555690926080, '交通', 'material', '6d8840', '摩托车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721284127921, 1067246875800000001, 1724058718474, 0); +INSERT INTO "public"."iot_group_info" VALUES (171430822061019136, '交通', 'material', 'f8a95a', '高尔夫车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721283953010, 1067246875800000001, 1724229924190, 0); +INSERT INTO "public"."iot_group_info" VALUES (170985871846150144, '建筑施工', 'material', 'd4ea02', '采石场', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177868612, 1067246875800000001, 1723195750585, 0); +INSERT INTO "public"."iot_group_info" VALUES (171421231952695296, '磨煤机', 'material', '733c45', '磨煤机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721281666550, 1067246875800000001, 1721282571073, 0); +INSERT INTO "public"."iot_group_info" VALUES (170984235794960384, '航空', 'material', 'a409be', '热气球', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177478547, 1067246875800000001, 1721812065467, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872806684430336, '运动', 'material', '7bc29b', '体育家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627748935, 1067246875800000001, 1721874109239, 0); +INSERT INTO "public"."iot_group_info" VALUES (170984067817279488, '航空', 'material', '7f6652', '救援飞机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177438498, 1067246875800000001, 1721811983972, 0); +INSERT INTO "public"."iot_group_info" VALUES (171452906845769728, '路面', 'material', 'a803dc', '广告牌', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289218433, 1067246875800000001, 1721812548524, 0); +INSERT INTO "public"."iot_group_info" VALUES (170984299179282432, '航空', 'material', 'b314a0', '直升飞机', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177493659, 1067246875800000001, 1721812081072, 0); +INSERT INTO "public"."iot_group_info" VALUES (171390641677275136, '交通', 'material', 'cef318', '地面设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721274373260, 1067246875800000001, 1724058768606, 0); +INSERT INTO "public"."iot_group_info" VALUES (171436920797138944, '交通', 'material', 'b77fd2', '铁路交通', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285407062, 1067246875800000001, 1724059806439, 0); +INSERT INTO "public"."iot_group_info" VALUES (171431148499505152, '交通', 'material', 'ffa29b', '集装箱', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721284030839, 1067246875800000001, 1724058495830, 0); +INSERT INTO "public"."iot_group_info" VALUES (170986057599291392, '建筑施工', 'material', '760412', '建筑工地', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177912899, 1067246875800000001, 1723195813598, 0); +INSERT INTO "public"."iot_group_info" VALUES (171430868944949248, '交通', 'material', '4aab38', '公共交通', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721283964188, 1067246875800000001, 1724229944311, 0); +INSERT INTO "public"."iot_group_info" VALUES (171431457158336512, '交通', 'material', '8708f7', '轮船', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721284104429, 1067246875800000001, 1724058570101, 0); +INSERT INTO "public"."iot_group_info" VALUES (171436965080600576, '交通', 'material', '86d17e', '小汽车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285417620, 1067246875800000001, 1724229851658, 0); +INSERT INTO "public"."iot_group_info" VALUES (168557285398810624, '仓库', 'material', '8ca3f6', '仓库标志', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598848482, 1067246875800000001, 1721629038634, 0); +INSERT INTO "public"."iot_group_info" VALUES (168556859114917888, 'IT网络', 'material', '5fda18', '形状', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598746848, 1067246875800000001, 1721628697768, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995122090020864, '建筑物', 'material', 'f3c518', '传统建筑', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180074042, 1067246875800000001, 1721812135039, 0); +INSERT INTO "public"."iot_group_info" VALUES (170994936366239744, '建筑施工', 'material', 'a2ee33', '施工设施', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180029762, 1067246875800000001, 1723195870337, 0); +INSERT INTO "public"."iot_group_info" VALUES (170628071869648896, '符号', 'material', '537130', 'IT网络符号', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092562450, 1067246875800000001, 1723519602431, 10); +INSERT INTO "public"."iot_group_info" VALUES (171438379966140416, '路面', 'material', '3f48dd', '标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285754955, 1067246875800000001, 1721812486736, 0); +INSERT INTO "public"."iot_group_info" VALUES (168574617793859584, '仓库', 'material', '9d39ef', '仓库人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720602980847, 1067246875800000001, 1723519974546, 4); +INSERT INTO "public"."iot_group_info" VALUES (170996790185693184, '建筑物', 'material', 'eb4465', '门防护栅栏', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180471747, 1067246875800000001, 1721812301356, 0); +INSERT INTO "public"."iot_group_info" VALUES (171453139096965120, '路面', 'material', 'b7b606', '桥梁', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289273806, 1067246875800000001, 1721812633198, 0); +INSERT INTO "public"."iot_group_info" VALUES (171453353845329920, '农业', 'material', '2c44d4', '农民', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289325006, 1067246875800000001, 1724057295623, 0); +INSERT INTO "public"."iot_group_info" VALUES (171453180201144320, '路面', 'material', '0b412f', '停车场', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289283606, 1067246875800000001, 1721812652209, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995240201621504, '建筑物', 'material', 'b7e3ab', '公共建筑', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180102202, 1067246875800000001, 1721812179903, 0); +INSERT INTO "public"."iot_group_info" VALUES (171437010479747072, '交通', 'material', 'fde63a', '小型车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285428444, 1067246875800000001, 1724229873566, 0); +INSERT INTO "public"."iot_group_info" VALUES (170999231576805376, '建筑物', 'material', 'ef46e5', '商业建筑', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721181053820, 1067246875800000001, 1721812345347, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833300006572032, '暖通空调', 'material', '23ac26', '矩形管道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618329809, 1067246875800000001, 1721812782410, 0); +INSERT INTO "public"."iot_group_info" VALUES (171437132093591552, '交通', 'material', '2be552', '重型设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285457440, 1067246875800000001, 1724229905404, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834704351825920, '室内', 'material', 'f1c31c', '桌椅', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618664631, 1067246875800000001, 1723538547078, 0); +INSERT INTO "public"."iot_group_info" VALUES (172838981791125504, '铁路', 'material', '15bb01', '货运站', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619684452, 1067246875800000001, 1723511385436, 0); +INSERT INTO "public"."iot_group_info" VALUES (170628350472097792, '符号', 'material', '7b2ecf', '电力能源', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092628874, 1067246875800000001, 1723519423271, 0); +INSERT INTO "public"."iot_group_info" VALUES (171437073641771008, '交通', 'material', '1a467b', '娱乐车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721285443503, 1067246875800000001, 1724229887961, 0); +INSERT INTO "public"."iot_group_info" VALUES (172864920788930560, '图形', 'material', '1dec9e', '3D图形', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625868791, 1067246875800000001, 1723538610426, 0); +INSERT INTO "public"."iot_group_info" VALUES (171783958281850880, '瑞鼎', 'thing', '20240719', '', 0, NULL, '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721368147246, 1067246875800000001, 1721368147246, 2); +INSERT INTO "public"."iot_group_info" VALUES (172832826113134592, '农业', 'material', '2fe6ef', '农业小型设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618216824, 1067246875800000001, 1724057539018, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834573007196160, '室内', 'material', 'bb067b', '特殊家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618633316, 1067246875800000001, 1723538497362, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865044462178304, '物流', 'material', '93dc92', '飞机', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625898277, 1067246875800000001, 1724058266190, 0); +INSERT INTO "public"."iot_group_info" VALUES (172864826895241216, '图形', 'material', '0942d5', '1D图形', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625846405, 1067246875800000001, 1723538581857, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833832158892032, '生产制造', 'material', '3bb5df', '生产人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618456684, 1067246875800000001, 1724230266502, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834471395987456, '室内', 'material', '89e3c4', '室内', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618609090, 1067246875800000001, 1723538460047, 0); +INSERT INTO "public"."iot_group_info" VALUES (172839028926713856, '铁路', 'material', '5af57e', '客运机车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619695690, 1067246875800000001, 1723511402894, 0); +INSERT INTO "public"."iot_group_info" VALUES (170628240229011456, '符号', 'material', '5ed497', '常用标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092602590, 1067246875800000001, 1723519387402, 0); +INSERT INTO "public"."iot_group_info" VALUES (172839088594882560, '铁路', 'material', '75336e', '设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619709916, 1067246875800000001, 1723511424549, 0); +INSERT INTO "public"."iot_group_info" VALUES (172839142315528192, '铁路', 'material', 'd6b6b1', '隧道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619722724, 1067246875800000001, 1723511442459, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834160317042688, '室内', 'material', '47a980', '厨房设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618534923, 1067246875800000001, 1723538351611, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834617294852096, '室内', 'material', '5cf1c6', '卧室', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618643875, 1067246875800000001, 1723538515601, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832289745539072, '农业', 'material', 'daf8f2', '农业产品', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618088944, 1067246875800000001, 1723539105502, 0); +INSERT INTO "public"."iot_group_info" VALUES (172864873686896640, '图形', 'material', '167bd2', '2D图形', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625857561, 1067246875800000001, 1723538595654, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865009167110144, '物流', 'material', 'f5c68a', '吊车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625889862, 1067246875800000001, 1724058248373, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832648547274752, '农业', 'material', '34a01b', '农业路面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618174489, 1067246875800000001, 1724057377030, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833745143861248, '生产制造', 'material', '298eb9', '打印设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618435938, 1067246875800000001, 1724230233275, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832531660410880, '农业', 'material', 'c743a4', '农业家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618146621, 1067246875800000001, 1723539138380, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832716998316032, '农业', 'material', 'c2ed59', '农业设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618190809, 1067246875800000001, 1724057391873, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833966208847872, '生产制造', 'material', 'e9e3a2', '小型设备包装', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618488644, 1067246875800000001, 1724230300045, 0); +INSERT INTO "public"."iot_group_info" VALUES (170999169123618816, '建筑物', 'material', 'fee89b', '农业设施', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721181038930, 1067246875800000001, 1721812323564, 0); +INSERT INTO "public"."iot_group_info" VALUES (171452952366551040, '路面', 'material', '3bd19b', '轨道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289229286, 1067246875800000001, 1721812567782, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834112971739136, '室内', 'material', 'bb96e1', '厨房', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618523635, 1067246875800000001, 1723538334895, 0); +INSERT INTO "public"."iot_group_info" VALUES (168556999812845568, '办公室', 'material', '046c50', '办公家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598780393, 1067246875800000001, 1721628731273, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865116780367872, '物流', 'material', '5c5cf8', '轮船', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625915519, 1067246875800000001, 1724058301982, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995179610705920, '建筑物', 'material', '6d42f0', '工业设施', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180087756, 1067246875800000001, 1721812154641, 0); +INSERT INTO "public"."iot_group_info" VALUES (171453316717350912, '农业', 'material', 'a42be0', '农场动物', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289316154, 1067246875800000001, 1723539083616, 0); +INSERT INTO "public"."iot_group_info" VALUES (170995014812307456, '建筑施工', 'material', 'ed7a55', '重型设备', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721180048465, 1067246875800000001, 1723195904285, 0); +INSERT INTO "public"."iot_group_info" VALUES (168560863983177728, '仓库', 'material', 'dfb251', '仓库车辆', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720599701684, 1067246875800000001, 1721629058342, 0); +INSERT INTO "public"."iot_group_info" VALUES (172864616785776640, '图表', 'material', 'a4685e', '饼图', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625796311, 1067246875800000001, 1723519638463, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833886923919360, '生产制造', 'material', '275529', '生产设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618469741, 1067246875800000001, 1724230283049, 0); +INSERT INTO "public"."iot_group_info" VALUES (168557092221751296, '办公室', 'material', 'fcdcea', '办公人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598802425, 1067246875800000001, 1723441333768, 4); +INSERT INTO "public"."iot_group_info" VALUES (171453102606520320, '路面', 'material', '3dfda0', '路', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289265106, 1067246875800000001, 1721812611304, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834027311468544, '生产制造', 'material', 'c19be0', '原材料和产品', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618503212, 1067246875800000001, 1724230314812, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627334326456320, '电力资源', 'material', 'c2a26e', '电力', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092386606, 1067246875800000001, 1724230532449, 1); +INSERT INTO "public"."iot_group_info" VALUES (172832467135238144, '农业', 'material', '17524a', '农业机动车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618131237, 1067246875800000001, 1723539122827, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872870664343552, '运动', 'material', '920f78', '体育人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627764189, 1067246875800000001, 1721875494418, 0); +INSERT INTO "public"."iot_group_info" VALUES (170983899285950464, '航空', 'material', 'ec45ac', '航空人员', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721177398317, 1067246875800000001, 1721786744188, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834903774203904, '铁路', 'material', 'f2a66a', '轨道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618712177, 1067246875800000001, 1723511324857, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627845045882880, '冬季', 'material', '7b7991', '人', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092508371, 1067246875800000001, 1724230740735, 6); +INSERT INTO "public"."iot_group_info" VALUES (172865779945967616, '医疗保健', 'material', 'ea764c', '建筑设施', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721626073630, 1067246875800000001, 1724230198259, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865166998769664, '物流', 'material', 'ffc572', '物流标志', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625927492, 1067246875800000001, 1724058365196, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627735356444672, '电力资源', 'material', '8082b5', '石油天然气', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092482219, 1067246875800000001, 1724230553136, 2); +INSERT INTO "public"."iot_group_info" VALUES (172864654828113920, '图表', 'material', 'f9c462', '积木', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625805381, 1067246875800000001, 1723519776995, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865210153963520, '物流', 'material', 'bc9bda', '物流地图', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625937781, 1067246875800000001, 1724058381547, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627424143282176, '电力资源', 'material', 'dfeb86', '电力标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092408020, 1067246875800000001, 1724230601230, 7); +INSERT INTO "public"."iot_group_info" VALUES (171111998078062592, '建筑物', 'material', '0a4609', '设施部件', 0, '', '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1721207939449, 1067246875800000001, 1721812367344, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874074316345344, '人类', 'material', '27be05', '多元文化人类', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628051162, 1067246875800000001, 1721876781314, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834284661379072, '室内', 'material', 'c07c55', '客厅', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618564569, 1067246875800000001, 1723538368583, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627896879091712, '冬季', 'material', '1b6608', '圣诞节日', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092520729, 1067246875800000001, 1724230704020, 1); +INSERT INTO "public"."iot_group_info" VALUES (181218104636997632, '电表', 'thing', 'A0001', '', 1, NULL, '', 460730634407510016, 460730634407510016, 460730634407510016, 1067246875800000001, 1723617423015, 1067246875800000001, 1723617423015, 3); +INSERT INTO "public"."iot_group_info" VALUES (172864689531785216, '图表', 'material', '497407', '箭头', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625813655, 1067246875800000001, 1723519795629, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834972061667328, '铁路', 'material', 'c33af8', '火车站', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618728458, 1067246875800000001, 1723511347388, 0); +INSERT INTO "public"."iot_group_info" VALUES (171453216616091648, '路面', 'material', 'ca0276', '小路', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721289292288, 1067246875800000001, 1721812674044, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627238843125760, '城市设施', 'material', 'db1ce0', '自然', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092363841, 1067246875800000001, 1724230784780, 3); +INSERT INTO "public"."iot_group_info" VALUES (172874122072690688, '人类', 'material', 'a12e24', '多元文化小孩', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628062548, 1067246875800000001, 1721877074310, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865248800280576, '物流', 'material', '913bdc', '物流集装箱', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625946995, 1067246875800000001, 1724058396009, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834323890704384, '室内', 'material', 'cfe724', '楼梯', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618573922, 1067246875800000001, 1723538384839, 0); +INSERT INTO "public"."iot_group_info" VALUES (172835039120199680, '铁路', 'material', 'fa3a60', '货运机车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618744446, 1067246875800000001, 1723511369084, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832590527467520, '农业', 'material', '7139d0', '农业建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618160656, 1067246875800000001, 1724057356606, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872687385841664, '医疗保健', 'material', 'e10d0c', '医院', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627720492, 1067246875800000001, 1724230051894, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873396470681600, '自然界', 'material', 'c18d0f', '河流', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627889552, 1067246875800000001, 1724057804064, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865592200531968, '物流', 'material', '1cd4cb', '抓车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721626028868, 1067246875800000001, 1724058444279, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873658870534144, '自然界', 'material', '5c8332', '山丘', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627952112, 1067246875800000001, 1724057940923, 0); +INSERT INTO "public"."iot_group_info" VALUES (172864738454147072, '图表', 'material', '479d21', '柱形图', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625825319, 1067246875800000001, 1723519816285, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873355383279616, '自然界', 'material', '7bb00c', '海洋', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627879755, 1067246875800000001, 1724057788663, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873243248562176, '自然界', 'material', 'c61d9c', '采石场', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627853020, 1067246875800000001, 1724057593986, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872013398937600, '医疗保健', 'material', '4aaa9e', '实验室', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627559801, 1067246875800000001, 1724230180272, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873696396972032, '自然界', 'material', 'de437a', '天气', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627961060, 1067246875800000001, 1724057955784, 0); +INSERT INTO "public"."iot_group_info" VALUES (172865281331302400, '物流', 'material', 'aa56cb', '物流卡车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721625954751, 1067246875800000001, 1724058410983, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872418568704000, '医疗保健', 'material', 'b155cb', '医疗档案', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627656401, 1067246875800000001, 1724230136251, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873782128545792, '自然界', 'material', '8521cf', '土壤', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627981499, 1067246875800000001, 1724057972557, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873819600457728, '自然界', 'material', '1f5a85', '下雪', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627990433, 1067246875800000001, 1724057989840, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872471807004672, '医疗保健', 'material', 'bf57eb', '医疗家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627669094, 1067246875800000001, 1724230121369, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873435851001856, '自然界', 'material', 'e54140', '恐龙', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627898940, 1067246875800000001, 1724057821234, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872530749558784, '医疗保健', 'material', 'fec066', '医疗器具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627683148, 1067246875800000001, 1724230105453, 0); +INSERT INTO "public"."iot_group_info" VALUES (172872360553091072, '医疗保健', 'material', 'd960f4', '医疗车辆', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627642569, 1067246875800000001, 1724230150515, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624665616650240, '城市设施', 'material', '2214fb', '建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091750336, 1067246875800000001, 1724230808505, 4); +INSERT INTO "public"."iot_group_info" VALUES (172872179845697536, '医疗保健', 'material', '6a5a35', '医疗标志', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627599485, 1067246875800000001, 1724230166343, 0); +INSERT INTO "public"."iot_group_info" VALUES (168554047169630208, 'IT网络', 'material', 'f6d352', '3D图形', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598076428, 1067246875800000001, 1721628433885, 0); +INSERT INTO "public"."iot_group_info" VALUES (172839181884592128, '铁路', 'material', 'c8434f', '铁路标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619732158, 1067246875800000001, 1723511466489, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874177802407936, '人类', 'material', '28eee1', '服务人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628075835, 1067246875800000001, 1721877089302, 0); +INSERT INTO "public"."iot_group_info" VALUES (172834358887976960, '室内', 'material', 'efc974', '门窗', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618582266, 1067246875800000001, 1723538409030, 0); +INSERT INTO "public"."iot_group_info" VALUES (172832910896795648, '农业', 'material', 'c42287', '农业自然', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618237038, 1067246875800000001, 1724057554612, 0); +INSERT INTO "public"."iot_group_info" VALUES (172839250658594816, '铁路', 'material', '22f5e1', '铁路人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721619748555, 1067246875800000001, 1723511485721, 0); +INSERT INTO "public"."iot_group_info" VALUES (172873277360836608, '自然界', 'material', '368ad8', '地面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627861153, 1067246875800000001, 1724057625363, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874212178923520, '人类', 'material', '9b0047', '工人', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628084031, 1067246875800000001, 1721877109799, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833017771855872, '暖通空调', 'material', 'ee8554', '方形管道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618262519, 1067246875800000001, 1721812739011, 0); +INSERT INTO "public"."iot_group_info" VALUES (170626998010384384, '城市设施', 'material', '2b0728', '路面', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092306422, 1067246875800000001, 1724230833626, 5); +INSERT INTO "public"."iot_group_info" VALUES (172873317705846784, '自然界', 'material', 'c3cb4d', '动物', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721627870772, 1067246875800000001, 1724057645537, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874256776957952, '人类', 'material', '82ab68', '工资场所', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628094664, 1067246875800000001, 1721877132103, 0); +INSERT INTO "public"."iot_group_info" VALUES (172833249779781632, '暖通空调', 'material', '5ffbf5', '过渡管道', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721618317834, 1067246875800000001, 1721812759379, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874302939467776, '人类', 'material', '04dda8', '购物人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628105670, 1067246875800000001, 1721877179174, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874344022675456, '人类', 'material', '3acfee', '机器人', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628115465, 1067246875800000001, 1721877195522, 0); +INSERT INTO "public"."iot_group_info" VALUES (168556542570795008, 'IT网络', 'material', '2d588a', 'IT标记', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720598671378, 1067246875800000001, 1721628461380, 0); +INSERT INTO "public"."iot_group_info" VALUES (170627124007276544, '城市设施', 'material', '938c93', '人类', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092336462, 1067246875800000001, 1724230857807, 6); +INSERT INTO "public"."iot_group_info" VALUES (170624599996764160, '城市设施', 'material', '0de580', '机动车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091734691, 1067246875800000001, 1724230902325, 9); +INSERT INTO "public"."iot_group_info" VALUES (170627178164129792, '城市设施', 'material', '25171a', '小型车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721092349374, 1067246875800000001, 1724230877468, 7); +INSERT INTO "public"."iot_group_info" VALUES (172874451895980032, '人类', 'material', '059372', '基础人类', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628141184, 1067246875800000001, 1721877212616, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874500818341888, '人类', 'material', 'ce613e', '急救人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628152848, 1067246875800000001, 1721877234894, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874549568737280, '人类', 'material', '1fc7ed', '建筑人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628164471, 1067246875800000001, 1721877254380, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624724659867648, '城市设施', 'material', 'a9cf92', '街道家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091764413, 1067246875800000001, 1724230920128, 10); +INSERT INTO "public"."iot_group_info" VALUES (172874597241196544, '人类', 'material', 'c8aa1a', '交通人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628175837, 1067246875800000001, 1721877274920, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874727537250304, '人类', 'material', '98298d', '军事人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628206902, 1067246875800000001, 1721877299784, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874804485951488, '人类', 'material', 'a33bff', '旅行人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628225248, 1067246875800000001, 1721877385882, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874845091008512, '人类', 'material', '17dd17', '农民', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628234929, 1067246875800000001, 1721877409746, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874893174509568, '人类', 'material', '08efc9', '商业人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628246393, 1067246875800000001, 1721877439303, 0); +INSERT INTO "public"."iot_group_info" VALUES (172874966088290304, '人类', 'material', '37a2f4', '体育人员和教练', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628263777, 1067246875800000001, 1721877462393, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875001446273024, '人类', 'material', '142ebc', '小孩', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628272207, 1067246875800000001, 1721877488742, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875042793721856, '人类', 'material', 'e38483', '休闲人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628282065, 1067246875800000001, 1721877509683, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875075064696832, '人类', 'material', '949697', '学生', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628289759, 1067246875800000001, 1721877531198, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875130882494464, '人类', 'material', '5a0f9c', '医疗护理人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628303067, 1067246875800000001, 1721877566491, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875180278812672, '人类', 'material', '90fc85', '音乐人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628314844, 1067246875800000001, 1721886573042, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875227737362432, '人类', 'material', 'e68ecf', '运输人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628326159, 1067246875800000001, 1721886594520, 0); +INSERT INTO "public"."iot_group_info" VALUES (172875313976446976, '人类', 'material', '598aa7', '组织人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721628346720, 1067246875800000001, 1721886615584, 0); +INSERT INTO "public"."iot_group_info" VALUES (168577113186635776, '超市', 'material', '0d5883', '超市电梯', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603575795, 1067246875800000001, 1721889906358, 0); +INSERT INTO "public"."iot_group_info" VALUES (168575291495550976, '超市', 'material', '0c3089', '超市标识', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1720603141470, 1067246875800000001, 1721889926649, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624122156486656, '超市', 'material', 'e67d7b', '超市家具', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091620765, 1067246875800000001, 1721889947959, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624183208775680, '超市', 'material', 'a93438', '超市建筑', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091635321, 1067246875800000001, 1721889970925, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624240687517696, '超市', 'material', 'fb683b', '超市建筑部件', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091649025, 1067246875800000001, 1721889988575, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624302335397888, '超市', 'material', 'e2b47b', '超市清洁设备', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091663723, 1067246875800000001, 1721890022995, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624342189674496, '超市', 'material', 'a4a03b', '超市人员', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091673225, 1067246875800000001, 1721890039046, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624397952946176, '超市', 'material', '834df1', '超市收银台', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091686520, 1067246875800000001, 1721890068971, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624453586194432, '超市', 'material', '4553fd', '超市推车', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091699784, 1067246875800000001, 1721890086873, 0); +INSERT INTO "public"."iot_group_info" VALUES (170624498880483328, '超市', 'material', '074e10', '超市杂货', 0, '', '', 1001, 1001, 1001, 1067246875800000001, 1721091710583, 1067246875800000001, 1721890103986, 0); + +-- ---------------------------- +-- Table structure for iot_group_relation +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_group_relation"; +CREATE TABLE "public"."iot_group_relation" ( + "id" int8 NOT NULL, + "group_id" int8 NOT NULL, + "entity_id" int8 NOT NULL, + "entity_type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL +) +; +COMMENT ON COLUMN "public"."iot_group_relation"."id" IS 'id'; +COMMENT ON COLUMN "public"."iot_group_relation"."group_id" IS '组id'; +COMMENT ON COLUMN "public"."iot_group_relation"."entity_id" IS '实体id 比如thing_entity_id'; +COMMENT ON COLUMN "public"."iot_group_relation"."entity_type" IS '实体类型:物实体- thing'; +COMMENT ON TABLE "public"."iot_group_relation" IS '实体&组 的关系表'; + +-- ---------------------------- +-- Records of iot_group_relation +-- ---------------------------- + +-- ---------------------------- +-- Table structure for iot_section_detail +-- ---------------------------- +DROP TABLE IF EXISTS "public"."iot_section_detail"; +CREATE TABLE "public"."iot_section_detail" ( + "id" int8 NOT NULL, + "name" varchar(255) COLLATE "pg_catalog"."default", + "alias_name" varchar(255) COLLATE "pg_catalog"."default", + "group_id" int8, + "image" text COLLATE "pg_catalog"."default", + "image_type" varchar(255) COLLATE "pg_catalog"."default", + "config" text COLLATE "pg_catalog"."default", + "js_plugin" text COLLATE "pg_catalog"."default", + "json" text COLLATE "pg_catalog"."default", + "css" text COLLATE "pg_catalog"."default", + "javascript" text COLLATE "pg_catalog"."default", + "remarks" varchar(1024) COLLATE "pg_catalog"."default", + "tenant_code" int8, + "company_id" int8, + "dept_id" int8, + "creator" int8, + "create_date" int8, + "updater" int8, + "update_date" int8, + "is_default" bool, + "section_type" varchar(255) COLLATE "pg_catalog"."default", + "is_local" bool, + "is_remote" bool, + "fake_data" text COLLATE "pg_catalog"."default" +) +; +COMMENT ON COLUMN "public"."iot_section_detail"."id" IS '部件id'; +COMMENT ON COLUMN "public"."iot_section_detail"."name" IS '部件名称'; +COMMENT ON COLUMN "public"."iot_section_detail"."alias_name" IS '部件别名'; +COMMENT ON COLUMN "public"."iot_section_detail"."group_id" IS '部件组id'; +COMMENT ON COLUMN "public"."iot_section_detail"."image" IS '文件url'; +COMMENT ON COLUMN "public"."iot_section_detail"."image_type" IS '文件类型'; +COMMENT ON COLUMN "public"."iot_section_detail"."config" IS '部件设置信息'; +COMMENT ON COLUMN "public"."iot_section_detail"."js_plugin" IS '部件插件:数组结构'; +COMMENT ON COLUMN "public"."iot_section_detail"."json" IS 'json'; +COMMENT ON COLUMN "public"."iot_section_detail"."css" IS 'css'; +COMMENT ON COLUMN "public"."iot_section_detail"."javascript" IS 'javascript'; +COMMENT ON COLUMN "public"."iot_section_detail"."remarks" IS '备注说明'; +COMMENT ON COLUMN "public"."iot_section_detail"."tenant_code" IS '所属企业(租户code)'; +COMMENT ON COLUMN "public"."iot_section_detail"."company_id" IS '企业详情id'; +COMMENT ON COLUMN "public"."iot_section_detail"."dept_id" IS '部门id'; +COMMENT ON COLUMN "public"."iot_section_detail"."creator" IS '创建者'; +COMMENT ON COLUMN "public"."iot_section_detail"."create_date" IS '创建时间'; +COMMENT ON COLUMN "public"."iot_section_detail"."updater" IS '更新者'; +COMMENT ON COLUMN "public"."iot_section_detail"."update_date" IS '更新时间'; +COMMENT ON COLUMN "public"."iot_section_detail"."is_default" IS '是否默认'; +COMMENT ON COLUMN "public"."iot_section_detail"."section_type" IS '数据类型'; +COMMENT ON COLUMN "public"."iot_section_detail"."is_local" IS '是否本地'; +COMMENT ON COLUMN "public"."iot_section_detail"."is_remote" IS '是否远程'; +COMMENT ON COLUMN "public"."iot_section_detail"."fake_data" IS '静态数据'; +COMMENT ON TABLE "public"."iot_section_detail" IS '部件管理基本信息'; + +-- ---------------------------- +-- Records of iot_section_detail +-- ---------------------------- +INSERT INTO "public"."iot_section_detail" VALUES (1739102613632192513, 'custom-scrolltable-node', '表格', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"switch","label":"渲染空表格","option":"","name":"emptyTable","falseValue":false,"trueValue":true,"id":"u:acbab600e88b","value":false,"mode":"horizontal","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"提示:","content":"渲染空表格,意味着不再渲染来自数据源的数据,意味着可以拖拽“文本” 部件 或其它任何部件到单元格。渲染空表格时,请确保【没有】绑定数据点。"}},{"type":"input-number","label":"表列数","name":"colNum","keyboard":true,"id":"u:530cb9456502","step":1,"mode":"horizontal","inputClassName":"w-full","visibleOn":"this.emptyTable","value":3},{"type":"input-number","label":"表行数","name":"rowNum","keyboard":true,"id":"u:88b944e2e694","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"表头高度","name":"headerHeight","keyboard":true,"id":"u:859eacd8676d","step":1,"mode":"horizontal","value":"","inputClassName":"w-full"},{"type":"input-color","label":"表背景色","name":"tableBGC","id":"u:037d3f839c33","format":"rgba","value":"rgba(0, 186, 255, 1)","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"表头背景色","name":"headerBGC","id":"u:ea904dcf505c","format":"rgba","value":"rgba(0, 186, 255, 1)","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"奇数行背景色","name":"oddRowBGC","id":"u:4e1231994a61","format":"rgba","value":"rgba(0, 59, 81, 1)","mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"奇数行渐变背景","name":"oddRowGradBG","id":"u:2dd7d7ff6e90","editorState":"default","mode":"horizontal"},{"type":"input-color","label":"偶数行背景色","name":"evenRowBGC","id":"u:f9fab90331c2","format":"rgba","value":"rgba(10, 39, 50, 1)","mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"偶数行渐变背景","name":"evenRowGradBG","id":"u:a03dce775fd5","editorState":"default","mode":"horizontal"},{"type":"input-color","label":"高亮行背景色","name":"highlightBGC","id":"u:d693bc5c139b","format":"rgba","value":"rgba(10, 39, 50, 1)","mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"高亮行渐变背景","name":"highlightGradBG","id":"u:3067ffba315c","editorState":"default","mode":"horizontal"},{"type":"input-color","label":"高亮行字体颜色","name":"highlightFontColor","id":"u:0048fcafb112","format":"rgba","value":"","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"点击高亮行","option":"","name":"clickHighlight","falseValue":false,"trueValue":true,"id":"u:d4a40e5ad316","value":false,"mode":"horizontal"},{"type":"switch","label":"开启所有边框","option":"","name":"enableBorder","falseValue":false,"trueValue":true,"id":"u:b077b0c1ce5e","value":false,"mode":"horizontal"},{"type":"switch","label":"仅外边框","option":"","name":"onlyOuterBorder","falseValue":false,"trueValue":true,"id":"u:a695f4e62e35","value":false,"mode":"horizontal"},{"type":"switch","label":"仅表头边框","option":"","name":"onlyHeaderBorder","falseValue":false,"trueValue":true,"id":"u:17878008bbed","value":false,"mode":"horizontal"},{"type":"switch","label":"表头仅横向边框","option":"","name":"onlyHeaderHoriBorder","falseValue":false,"trueValue":true,"id":"u:912cb9647cb4","value":false,"mode":"horizontal"},{"type":"switch","label":"仅表体边框","option":"","name":"onlyBodyBorder","falseValue":false,"trueValue":true,"id":"u:37bd6c515bb3","value":false,"mode":"horizontal"},{"type":"select","label":"表体边框风格","name":"bodyBorderStyle","options":[{"label":"实线","value":"solid"},{"label":"虚线","value":"dashed"}],"id":"u:3d06eb4f02c1","multiple":false,"mode":"horizontal","inputClassName":"w-full","value":"solid"},{"type":"switch","label":"表体仅横向边框","option":"","name":"onlyHoriBorder","falseValue":false,"trueValue":true,"id":"u:494cb591c1da","value":false,"mode":"horizontal"},{"type":"input-color","label":"边框颜色","name":"borderColor","id":"u:a7b5b2ae82c1","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"combo","label":"列宽度","name":"columnWidth","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:2cc14b06d765"},"items":[{"type":"input-text","name":"col","placeholder":"文本","id":"u:e06e533226e1","editorState":"default","label":"列"},{"type":"input-number","name":"colW","placeholder":"","id":"u:443daabf4e98","label":"宽度"}],"id":"u:79429d21574f","strictMode":true,"syncFields":[],"mode":"horizontal","inputClassName":"w-full"},{"type":"combo","label":"列对齐","name":"align","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:2297905fc785"},"items":[{"type":"input-text","name":"col","placeholder":"文本","id":"u:a10bfc4da6f2","editorState":"default","label":"列"},{"type":"select","name":"align","placeholder":"选项","options":[{"label":"左对齐","value":"left"},{"label":"居中对齐","value":"center"},{"label":"右对齐","value":"right"}],"id":"u:80784d6fc30e","multiple":false,"label":"对齐"}],"id":"u:74a75875151f","strictMode":true,"syncFields":[],"mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示行号","option":"","name":"index","falseValue":false,"trueValue":true,"id":"u:7751ee009d1f","value":false,"mode":"horizontal"},{"type":"select","label":"轮播方式","name":"carousel","options":[{"label":"单行","value":"single"},{"label":"单页","value":"page"}],"id":"u:c87e427af127","multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"开启轮播","option":"","name":"enableCarousel","falseValue":false,"trueValue":true,"id":"u:fd08c5417853","value":false,"mode":"horizontal"},{"type":"input-number","label":"轮播时间间隔","name":"waitTime","keyboard":true,"id":"u:4153f8822ab0","step":1,"value":"","unitOptions":["ms"],"mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"悬浮暂停轮播","option":"","name":"hoverPause","falseValue":false,"trueValue":true,"id":"u:fdddfae70f25","value":false,"mode":"horizontal"},{"type":"input-color","label":"表字体颜色","name":"fontColor","id":"u:33b76afeb08a","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-range","label":"表字体大小","name":"fontSize","id":"u:392d15d87a9b","multiple":false,"value":0,"min":0,"max":100,"step":1,"unit":"","tooltipPlacement":"auto","showInput":false,"parts":1,"showSteps":false,"marks":{},"mode":"horizontal"},{"type":"input-color","label":"表头字体颜色","name":"headerFontColor","id":"u:e1282c3f1558","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-range","label":"表头字体大小","name":"headerFontSize","id":"u:cc235e005e0e","multiple":false,"value":0,"min":0,"max":100,"step":1,"unit":"","tooltipPlacement":"auto","showInput":false,"parts":1,"showSteps":false,"marks":{},"mode":"horizontal"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"visibleOn":"!this.customDatasource"},{"type":"input-text","label":"默认值","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"},{"type":"input-number","label":"渲染间隔","name":"renderInterval","keyboard":true,"id":"u:3f7cb08b0e2b","step":1,"mode":"horizontal","unitOptions":["ms"],"min":30000,"labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"最低渲染间隔为30秒","title":"提示:"}},{"type":"switch","label":"开启渲染间隔","option":"","name":"renderIntervalEnabled","falseValue":false,"trueValue":true,"id":"u:457aaa1b64ed","value":true,"mode":"horizontal","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"提示:","content":"关闭渲染间隔,将会渲染socket 推送的实时数据,意味着此时配置的数据源api如果不是 “最新” 值,将不会渲染。并且关闭渲染间隔后,需保存并刷新看板,才能看到效果。"}},{"type":"switch","label":"自定义数据源","option":"","name":"customDatasource","falseValue":false,"trueValue":true,"id":"u:648ca964f693","value":false,"mode":"horizontal"},{"type":"input-text","label":"数据源api","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"visibleOn":"this.customDatasource"},{"type":"radios","label":"请求方式","name":"requestMethod","options":[{"label":"get 请求","value":"get"},{"label":"post 请求","value":"post"}],"id":"u:2c48207f4f65","mode":"horizontal","visibleOn":"this.customDatasource","value":"get"},{"type":"editor","label":"请求入参","name":"requestParams","id":"u:e94982b03d0c","language":"javascript","value":"return {};","visibleOn":"this.customDatasource","inputClassName":"","className":"text-left"},{"type":"editor","label":"数据过滤","name":"dataFilterFn","id":"u:f9ef754971e0","language":"javascript","value":"// datas 数据处理\n// .....\nconst defaultHeader = [''列1'', ''列2'', ''列3'']\nconst defaultDatas = [\n[{ val: ''行1列1'', style: {color: ''red''}},{ val: ''行1列2'', style: {color: ''green''}}, { val: ''行1列3'', style: {color: ''blue'', cursor: ''pointer''}}],\n[{ val: ''行2列1'', style: {color: ''red''}},{ val: ''行2列2'', style: {color: ''green''}}, { val: ''行2列3'', style: {color: ''blue'', cursor: ''pointer''}}],\n]\n// 或\n// const defaultDatas = [\n// [''行1列1'', ''行1列2'', ''行1列3''],\n// [''行2列1'', ''行2列2'', ''行2列3''],\n// ]\n\nreturn {\n headerDatas: defaultHeader ,\ntableDatas: defaultDatas \n}","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"入参api返回数据: datas"},"labelClassName":"text-left","inputClassName":"text-left","options":{"lineNumbers":"off"},"visibleOn":"this.customDatasource"},{"type":"switch","label":"测试数据","option":"","name":"enableTestDatas","falseValue":false,"trueValue":true,"id":"u:69f7cb2f3c34","value":false,"mode":"horizontal"},{"type":"editor","label":"测试数据组装并返回","name":"testDatas","id":"u:e52de9e4e231","language":"javascript","visibleOn":"this.enableTestDatas","className":"text-left"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":false,"removable":false,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"点击行","value":"change"}],"id":"u:a7b44847011a","label":"名称"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"},{"type":"fieldset","title":"目标节点发起请求","collapsable":true,"body":[{"type":"input-text","label":"目标节点","name":"targetNode","id":"u:6efb6f120e47","multiple":false,"mode":"horizontal","inputClassName":"w-full","visibleOn":"this.eventType === ''change''","removable":"true","placeholder":"目标节点id"},{"type":"select","label":"入参类型","name":"targetParamsType","options":[{"label":"物实体","value":"entitys"},{"label":"物属性","value":"attrs"},{"label":"时间","value":"times"}],"id":"u:d10a57a9b966","multiple":false,"mode":"horizontal","inputClassName":"w-full","removable":true},{"type":"radios","label":"入参实体","name":"targetParamsEntitys","options":[{"label":"物组","value":"group"},{"label":"列表","value":"list"},{"label":"关系","value":"relation"},{"label":"搜索","value":"search"},{"label":"标签","value":"tag"},{"label":"类型","value":"type"}],"id":"u:26df91ece010","onEvent":{"change":{"actions":[{"actionType":"custom","script":"console.log(''event'', event);"}]}},"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''entitys''"},{"type":"radios","label":"属性类型","name":"targetParamsAttrsType","options":[{"label":"分属性","value":"split"},{"label":"全部","value":"all"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参属性","name":"targetParamsAttrsKeysEntitys","options":[{"label":"物","value":"entitys"},{"label":"属性","value":"keys"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参时间","name":"targetParamsTimesType","options":[{"label":"最近","value":"nearest"},{"label":"时间段","value":"range"},{"label":"区间","value":"interval"}],"id":"u:26df91ece010","multiple":false,"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''times''"},{"type":"input-text","label":"超级api","name":"apiId","id":"u:912394455375","placeholder":"超级apiId"}],"id":"u:fbccd2ccc8a3"},{"type":"fieldset","title":"更多操作","collapsable":true,"body":[{"type":"tpl","tpl":"function (context, service, nodeId, event) {","inline":true,"wrapperComponent":"","id":"u:799cd3277731"},{"type":"editor","id":"u:77aca39f5961","label":"","name":"moreOperation","language":"javascript","className":"my-0"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:cd392cfb6ffb"}],"id":"u:51249df94c65","bodyClassName":"text-left"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"},"strictMode":true,"syncFields":[],"labelClassName":""}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "d11b46e7-237d-4ca8-96fc-4c0f7a011316", + "type": "custom-scrolltable-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "d11b46e7-237d-4ca8-96fc-4c0f7a011316", + "width": 500, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "emptyTable": false, + "headerHeight": 35, + "tableBGC": "rgba(5, 32, 73, 1)", + "headerBGC": "#00BAFF", + "oddRowBGC": "", + "evenRowBGC": "", + "highlightBGC": "", + "highlightFontColor": "rgba(245, 166, 35, 1)", + "clickHighlight": true, + "enableBorder": false, + "onlyOuterBorder": false, + "onlyHeaderBorder": false, + "onlyHeaderHoriBorder": false, + "onlyBodyBorder": false, + "bodyBorderStyle": "solid", + "onlyHoriBorder": false, + "index": false, + "enableCarousel": false, + "waitTime": "2000ms", + "hoverPause": false, + "fontSize": 12, + "headerFontSize": 14, + "showDefaultValue": false, + "showUnit": false, + "nodeAlias": "表格", + "rowNum": 5, + "columnWidth": [ + { + "col": "1", + "colW": 150 + } + ], + "carousel": "single", + "align": [ + { + "col": "1", + "align": "center" + } + ], + "headerFontColor": "#ffffff", + "fontColor": "#ffffff", + "borderColor": "#4a4a4a", + "colNum": 3, + "oddRowGradBG": "", + "evenRowGradBG": "", + "highlightGradBG": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "", + "renderIntervalEnabled": true, + "customDatasource": true, + "enableTestDatas": true, + "testDatas": "", + "renderInterval": "30000ms", + "dataFilterFn": "// datas 数据处理\r\n// datas.forEach().....\r\n\r\n// 返回格式为:\r\nconst defaultHeader = [{ val: ''列1'', style: { color: ''red'' } }, { val: ''列2'', style: { color: ''red'' } }, { val: ''列3'', style: { color: ''red'' } }]\r\nconst defaultDatas = [\r\n [{ val: ''行1列1'', style: { color: ''red'' } }, { val: ''行1列2'', style: { color: ''green'' } }, { val: ''行1列3'', style: { color: ''blue'', cursor: ''pointer'' } }],\r\n [{ val: ''行2列1'', style: { color: ''red'' } }, { val: ''行2列2'', style: { color: ''green'' } }, { val: ''行2列3'', style: { color: ''blue'', cursor: ''pointer'' } }],\r\n]\r\n// 或\r\n// const defaultHeader = [''列1'', ''列2'', ''列3'']\r\n// const defaultDatas = [\r\n// [''行1列1'', ''行1列2'', ''行1列3''],\r\n// [''行2列1'', ''行2列2'', ''行2列3''],\r\n// ]\r\nreturn {\r\n headerDatas: defaultHeader,\r\n tableDatas: defaultDatas\r\n}", + "requestMethod": "get", + "requestParams": "return {};" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "change", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "animationName": "旋转" + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '.bv-scroll-table { + position: relative; + width: 100%; + height: 100%; + color: #fff; +} + +.bv-scroll-table .text { + padding: 0 10px; + box-sizing: border-box; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.bv-scroll-table .header { + display: flex; + flex-direction: row; + font-size: 15px; +} + +.bv-scroll-table .header .header-item { + padding: 0 10px; + box-sizing: border-box; + transition: all 0.3s; +} + +.bv-scroll-table .rows { + overflow: hidden; +} + +.bv-scroll-table .rows::-webkit-scrollbar { + width: 8px; +} + +/* Track */ +.bv-scroll-table .rows::-webkit-scrollbar-track { + box-shadow: inset 0 0 1px grey; + border-radius: 4px; +} + +/* Handle */ +.bv-scroll-table .rows::-webkit-scrollbar-thumb { + background: #006FFF; + border-radius: 4px; +} + +/* Handle on hover */ +.bv-scroll-table .rows::-webkit-scrollbar-thumb:hover { + background: #0090FF; +} + +.bv-scroll-table .rows .row-item { + display: flex; + font-size: 14px; + transition: all 0.3s; +} + +.bv-scroll-table .rows .cell { + padding: 0 10px; + box-sizing: border-box; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.bv-scroll-table .rows .index { + border-radius: 3px; + padding: 0 3px; +} + +.scroll-table-tooltip { + position: absolute; + display: inline-block; + background-color: rgba(0, 0, 0, 0.65); + color: #ffffff; + font-size: 12px; + padding: 5px 5px; + max-width: 120px; + max-height: 120px; + overflow-y: auto; + z-index: 8888; + transition: all 0.2s; +}', '// 工具函数 +/** + * 精准判断对象类型 + * @param obj + */ +function typeOf(obj) { + const toString = Object.prototype.toString + const map = { + ''[object Boolean]'': ''boolean'', + ''[object Number]'': ''number'', + ''[object String]'': ''string'', + ''[object Function]'': ''function'', + ''[object Array]'': ''array'', + ''[object Date]'': ''date'', + ''[object RegExp]'': ''regExp'', + ''[object Undefined]'': ''undefined'', + ''[object Null]'': ''null'', + ''[object Object]'': ''object'', + } + return map[toString.call(obj)] +} + +/** + * 深拷贝 + * @param data + */ +function deepCopy(data) { + const t = typeOf(data) + let o + + if (t === ''array'') { + o = [] + } else if (t === ''object'') { + o = {} + } else { + return data + } + + if (t === ''array'') { + for (let i = 0; i < data.length; i++) { + o.push(deepCopy(data[i])) + } + } else if (t === ''object'') { + for (const i in data) { + o[i] = deepCopy(data[i]) + } + } + return o +} + +/** + * 深覆盖 + * @param target + * @param merged + */ +function deepMerge(target, merged) { + for (const key in merged) { + if (target[key] && typeof target[key] === ''object'') { + deepMerge(target[key], merged[key]) + continue + } + if (typeof merged[key] === ''object'') { + target[key] = deepCopy(merged[key]) + + continue + } + target[key] = merged[key] + } + + return target +} + + +/** + * 节流函数,(限制函数的执行频率)返回函数连续调用时,空闲时间必须大于或等于 wait,func 才会执行 + * @param {function} func 回调函数 + * @param {number} wait 表示时间窗口的间隔 + * @param immediate 是否立即执行 true 则先调用,false不先调用 + * @return {function} 返回客户调用函数 + */ +function throttle(func, wait, immediate) { + let timeoutID + let lastExec = 0 + + function wrapper() { + const self = this + const elapsed = Number(new Date()) - lastExec + const args = arguments + + function clearExistingTimeout() { + if (timeoutID) { + clearTimeout(timeoutID) + } + } + + function clear() { + timeoutID = undefined + } + + function exec() { + lastExec = Number(new Date()) + func.apply(self, args) + } + + if (immediate && !timeoutID) { + exec() + } + clearExistingTimeout() + if (immediate === undefined && elapsed > wait) { + exec() + } else { + timeoutID = setTimeout(immediate ? clear : exec, immediate === undefined ? wait - elapsed : wait) + } + } + + return wrapper +} + +/** + * 防抖函数,(限制函数的执行频率) 保证再一系列调用时间内,只调用一次 + * + * @param {function} func 回调函数 + * @param {number} wait 表示时间窗口的间隔 + * @return {function} 返回客户调用函数 + */ +function debounce(func, wait) { + return throttle(func, wait, false) +} + + +const { createApp, createVNode, render, nextTick, onBeforeUnmount, onUnmounted, onMounted, reactive, ref, toRefs, watch } = Vue; +const app = createApp({}) + +function useAutoResize(props, afterResizeFun) { + const domRef = ref(null) // dorm容器,默认设置为domRef + const status = reactive({ + width: 0, + height: 0, + }) + let __resizeHandler = null + + function resize(resize = true) { + nextTick().then(() => { + const dom = domRef.value + status.width = dom ? dom.clientWidth : 0 + status.height = dom ? dom.clientHeight : 0 + + if (!dom) { + console.warn(''fei-datav: Failed to get dom node, component rendering may be abnormal!'') + } else if (!status.width || !status.height) { + console.warn(''fei-datav: Component width or height is 0px, rendering abnormality may occur!'') + } + + if (typeof afterResizeFun === ''function'' && resize) afterResizeFun() + }) + } + + watch([() => props.containerWidth, () => props.containerHeight], () => { + __resizeHandler && __resizeHandler(); + }) + + onMounted(() => { + setTimeout(() => { + resize(); + }, 500) + __resizeHandler = debounce(resize, 100) + }) + + return { + domRef, + ...toRefs(status), + resize, + } +} + +const ScrollTable = { + template: ` +
+
+
+
+
+
+
+
+
+
+ `, + name: ''BvScrollTable'', + props: { + config: { + type: Object, + default: () => ({}), + }, + containerWidth: { + type: Number, + default: 500, + }, + containerHeight: { + type: Number, + default: 200, + }, + fontColor: { + type: String, + default: '''' + }, + fontSize: { + type: Number, + default: 12 + }, + headerFontColor: { + type: String, + default: '''' + }, + headerFontSize: { + type: Number, + default: 12 + }, + enableBorder: { + type: Boolean, + default: true + }, + borderColor: { + type: String, + default: '''' + }, + enableCarousel: { + type: Boolean, + default: false + }, + onlyOuterBorder: { + type: Boolean, + default: false + }, + onlyHeaderBorder: { + type: Boolean, + default: false + }, + onlyBodyBorder: { + type: Boolean, + default: false + }, + bodyBorderStyle: { + type: String, + default: ''solid'' + }, + onlyHoriBorder: { + type: Boolean, + default: false + }, + onlyHeaderHoriBorder: { + type: Boolean, + default: false + }, + tableBGC: { + type: String, + default: '''' + }, + clickHighlight: { + type: Boolean, + default: false + }, + highlightBGC: { + type: String, + default: '''' + }, + highlightGradBG: { + type: String, + default: '''' + }, + highlightNumber: { + type: Number, + default: -1 + }, + highlightFontColor: { + type: String, + default: '''' + } + }, + computed: { + tableStyle() { + const style = {}; + if (this.tableBGC) { + style.background = this.tableBGC + } + if (this.enableBorder || this.onlyOuterBorder) { + return { + border: `1px solid ${this.borderColor}`, + ''box-sizing'': ''border-box'', + ...style + } + } else { + return style + } + }, + getHeaderItemStyle: () => (widths, mergedConfig, i, header, enableBorder, borderColor, headerFontSize, headerFontColor, onlyOuterBorder, onlyHeaderBorder, onlyHeaderHoriBorder, headerItem, align) => { + const isLast = i === header.length - 1; + const borderObj = {} + if (enableBorder) { + !isLast && (borderObj[''border-right''] = `1px solid ${borderColor}`); + } + if (!enableBorder && !onlyOuterBorder && onlyHeaderBorder && !onlyHeaderHoriBorder) { + borderObj[''border-top''] = `1px solid ${borderColor}`; + borderObj[''border-bottom''] = `1px solid ${borderColor}`; + borderObj[''border-right''] = `1px solid ${borderColor}`; + i === 0 && (borderObj[''border-left''] = `1px solid ${borderColor}`); + } + if (!enableBorder && !onlyOuterBorder && onlyHeaderBorder && onlyHeaderHoriBorder) { + borderObj[''border-top''] = `1px solid ${borderColor}`; + borderObj[''border-bottom''] = `1px solid ${borderColor}`; + i === 0 && (borderObj[''border-left''] = `1px solid ${borderColor}`); + isLast && (borderObj[''border-right''] = `1px solid ${borderColor}`); + } + if (!enableBorder && onlyOuterBorder && onlyHeaderBorder && !onlyHeaderHoriBorder) { + borderObj[''border-bottom''] = `1px solid ${borderColor}`; + !isLast && (borderObj[''border-right''] = `1px solid ${borderColor}`); + } + if (!enableBorder && onlyOuterBorder && onlyHeaderBorder && onlyHeaderHoriBorder) { + borderObj[''border-bottom''] = `1px solid ${borderColor}`; + } + + let headItemStyle = {}; + if (headerItem.style) { + headItemStyle = { + ...headerItem.style + } + } + return { + ''height'': mergedConfig.headerHeight + ''px'', + ''width'': widths[i] + ''px'', + ''font-size'': headerFontSize + ''px'', + ''color'': headerFontColor, + ...borderObj, + ...headItemStyle, + display: ''flex'', + ''justify-content'': align === ''center'' ? ''center'' : align === ''left'' ? ''flex-start'' : align === ''right'' ? ''flex-end'' : ''left'', + ''align-items'': ''center'', + ''text-align'': align === ''center'' ? ''center'' : align === ''left'' ? ''left'' : align === ''right'' ? ''right'' : ''left'', + } + }, + getCellStyle: () => (widths, ci, cells, enableBorder, borderColor, fontSize, fontColor, onlyBodyBorder, bodyBorderStyle, onlyHoriBorder, onlyOuterBorder, cell, row, highlightFontColor) => { + const isLast = ci === cells.length - 1; + const borderObj = {} + if (enableBorder) { + !isLast && (borderObj[''border-right''] = `1px ${bodyBorderStyle} ${borderColor}`); + } + if (!enableBorder && !onlyOuterBorder && onlyBodyBorder && !onlyHoriBorder) { + borderObj[''border-right''] = `1px ${bodyBorderStyle} ${borderColor}`; + ci === 0 && (borderObj[''border-left''] = `1px ${bodyBorderStyle} ${borderColor}`); + } + if (!enableBorder && onlyOuterBorder && onlyBodyBorder && !onlyHoriBorder) { + !isLast && (borderObj[''border-right''] = `1px ${bodyBorderStyle} ${borderColor}`); + } + + let cellStyle = {}; + if (cell.style) { + cellStyle = { + ...cell.style + } + } + + const isHighlight = row.isHighlight; + let fontC = cellStyle.color || fontColor; + if (isHighlight) { + fontC = highlightFontColor; + } + + return { + width: widths[ci] + ''px'', + ''font-size'': fontSize + ''px'', + ...borderObj, + ...cellStyle, + ''color'': fontC, + } + }, + getRowsHeight() { + const { height, header, mergedConfig, enableCarousel } = this; + return { + height: height - (header.length ? mergedConfig.headerHeight : 0) + ''px'', + overflow: enableCarousel ? ''hidden'' : ''auto'' + } + }, + getRowItemStyle: () => (heights, mergedConfig, row, ri, highlightGradBG, highlightBGC, rows, enableBorder, borderColor, onlyBodyBorder, bodyBorderStyle, onlyHoriBorder, onlyOuterBorder) => { + const h = heights[ri]; + const isHighlight = row.isHighlight; + let background = mergedConfig[row.rowIndex % 2 === 0 ? ''evenRowBGC'' : ''oddRowBGC'']; + if (background.includes(''http'') && !background.includes(''url'')) { + background = `url(${background})`; + } + if (isHighlight) { + background = highlightGradBG || highlightBGC; + if (background.includes(''http'') && !background.includes(''url'')) { + background = `url(${background})`; + } + } + + const borderObj = {} + const isLastRow = ri === rows.length - 1; + if (enableBorder) { + ri === 0 && (borderObj[''border-top''] = `1px ${bodyBorderStyle} ${borderColor}`); + borderObj[''border-bottom''] = `1px ${bodyBorderStyle} ${borderColor}`; + } + if (!enableBorder && !onlyOuterBorder && onlyBodyBorder && !onlyHoriBorder) { + ri === 0 && (borderObj[''border-top''] = `1px ${bodyBorderStyle} ${borderColor}`); + borderObj[''border-bottom''] = `1px ${bodyBorderStyle} ${borderColor}`; + } + if (!enableBorder && !onlyOuterBorder && onlyBodyBorder && onlyHoriBorder) { + ri === 0 && (borderObj[''border-top''] = `1px ${bodyBorderStyle} ${borderColor}`); + borderObj[''border-bottom''] = `1px ${bodyBorderStyle} ${borderColor}`; + } + if (!enableBorder && onlyOuterBorder && onlyBodyBorder && !onlyHoriBorder) { + ri === 0 && (borderObj[''border-top''] = `1px ${bodyBorderStyle} ${borderColor}`); + !isLastRow && (borderObj[''border-bottom''] = `1px ${bodyBorderStyle} ${borderColor}`); + } + if (!enableBorder && onlyOuterBorder && onlyBodyBorder && onlyHoriBorder) { + ri === 0 && (borderObj[''border-top''] = `1px ${bodyBorderStyle} ${borderColor}`); + !isLastRow && (borderObj[''border-bottom''] = `1px ${bodyBorderStyle} ${borderColor}`); + } + + return { + height: h + ''px'', + ''line-height'': h + ''px'', + ''background'': background, + ''background-size'': ''100% 100%'', + ...borderObj + } + } + }, + emits: [''mouseover'', ''click''], + setup(props, { emit }) { + const { onUnmounted, watch, reactive, ref, toRefs } = Vue; + + const defaultConfig = ref({ + /** + * @description Board header + * @type {Array} + * @default header = [] + * @example header = [''column1'', ''column2'', ''column3''] + */ + header: [], + /** + * @description Board data + * @type {Array} + * @default data = [] + */ + data: [], + /** + * @description Row num + * @type {Number} + * @default rowNum = 5 + */ + rowNum: 5, + /** + * @description Header background color + * @type {String} + * @default headerBGC = ''#00BAFF'' + */ + headerBGC: ''#00BAFF'', + /** + * @description Odd row background color + * @type {String} + * @default oddRowBGC = ''#003B51'' + */ + oddRowBGC: ''#003B51'', + /** + * @description Even row background color + * @type {String} + * @default evenRowBGC = ''#003B51'' + */ + evenRowBGC: ''#0A2732'', + /** + * @description Scroll wait time + * @type {Number} + * @default waitTime = 2000 + */ + waitTime: 2000, + /** + * @description Header height + * @type {Number} + * @default headerHeight = 35 + */ + headerHeight: 35, + /** + * @description Column width + * @type {Array} + * @default columnWidth = [] + */ + columnWidth: [], + /** + * @description Column align + * @type {Array} + * @default align = [] + * @example align = [''left'', ''center'', ''right''] + */ + align: [], + /** + * @description Show index + * @type {Boolean} + * @default index = false + */ + index: false, + /** + * @description index Header + * @type {String} + * @default indexHeader = ''#'' + */ + indexHeader: ''#'', + /** + * @description Carousel type + * @type {String} + * @default carousel = ''single'' + * @example carousel = ''single'' | ''page'' + */ + carousel: ''single'', + /** + * @description Pause scroll when mouse hovered + * @type {Boolean} + * @default hoverPause = true + * @example hoverPause = true | false + */ + hoverPause: true, + }) + + function calcData() { + stopAnimation() + mergeConfig() + calcHeaderData() + calcRowsData() + calcWidths() + calcHeights() + calcAligns() + animation(true) + } + + const { domRef, width, height, resize } = useAutoResize(props, calcData) + const status = reactive({ + mergedConfig: null, + header: [], + rowsData: [], + rows: [], + widths: [], + heights: [], + avgHeight: 0, + aligns: [], + animationIndex: 0, + animationHandler: '''', + updater: 0, + needCalc: false, + }) + + function handleHover(enter, ri, ci, row, cell) { + if (enter) emitEvent(''mouseover'', ri, ci, row, cell) + if (!status.mergedConfig.hoverPause) return + const tooltip = document.querySelector(''.scroll-table-tooltip''); + if (enter) { + stopAnimation() + } else { + animation(true); + } + } + + function onResize() { + if (!status.mergedConfig) return + stopAnimation() + calcWidths() + calcHeights(true) + animation(true) + } + + function mergeConfig() { + status.mergedConfig = deepMerge(deepCopy(defaultConfig.value), props.config || {}) + } + + function calcHeaderData() { + let { header, index, indexHeader } = status.mergedConfig + if (!header.length) { + status.header = [] + return + } + header = [...header] + if (index) header.unshift(indexHeader) + status.header = header + } + + function calcRowsData() { + let { data, index, headerBGC, rowNum, enableCarousel } = status.mergedConfig + if (index) { + data = data.map((row, i) => { + row = [...row] + const indexTag = `${i + 1}`; + row.unshift(indexTag) + return row + }) + } + data = data.map((cells, i) => ({ cells, rowIndex: i })) + const rowLength = data.length + if (enableCarousel && rowLength > rowNum && rowLength < 2 * rowNum) { + data = [...data, ...data] + } + data = data.map((d, i) => ({ ...d, scroll: i })) + status.rowsData = data + status.rows = data + } + + function calcWidths() { + const { mergedConfig, rowsData } = status + const { columnWidth, header } = mergedConfig + const usedWidth = columnWidth.reduce((all, w) => all + w, 0) + let columnNum = 0 + if (rowsData[0]) { + columnNum = rowsData[0].cells.length + } else if (header.length) { + columnNum = header.length + } + const avgWidth = (width.value - usedWidth) / (columnNum - columnWidth.length) + const widths = new Array(columnNum).fill(avgWidth) + status.widths = deepMerge(widths, columnWidth) + } + + function calcHeights(onresize = false) { + const { mergedConfig, header } = status + const { headerHeight, rowNum, data } = mergedConfig + let allHeight = height.value + if (header.length) allHeight -= headerHeight + const avgHeight = allHeight / rowNum + status.avgHeight = avgHeight + if (!onresize) status.heights = new Array(data.length).fill(avgHeight) + } + + function calcAligns() { + const { header, mergedConfig } = status + const columnNum = header.length + let aligns = new Array(columnNum).fill(''left'') + const { align } = mergedConfig + status.aligns = deepMerge(aligns, align) + } + + async function animation(start = false) { + if (!props.enableCarousel) return; + const { needCalc, calcHeights, calcRowsData } = status + if (needCalc) { + calcRowsData() + calcHeights() + status.needCalc = false + } + let { avgHeight, animationIndex, mergedConfig, rowsData, updater } = status + const { waitTime, carousel, rowNum } = mergedConfig + const rowLength = rowsData.length + if (rowNum >= rowLength) return + if (start) { + await new Promise(resolve => setTimeout(resolve, waitTime)) + if (updater !== status.updater) return + } + const animationNum = carousel === ''single'' ? 1 : rowNum + let rows = rowsData.slice(animationIndex) + rows.push(...rowsData.slice(0, animationIndex)) + status.rows = rows.slice(0, carousel === ''page'' ? rowNum * 2 : rowNum + 1) + status.heights = new Array(rowLength).fill(avgHeight) + + await new Promise(resolve => setTimeout(resolve, 300)) + if (updater !== status.updater) return + + status.heights.splice(0, animationNum, ...new Array(animationNum).fill(0)) + + animationIndex += animationNum + + const back = animationIndex - rowLength + if (back >= 0) animationIndex = back + + status.animationIndex = animationIndex + status.animationHandler = setTimeout(animation, waitTime - 300) + } + + function stopAnimation() { + const { animationHandler, updater } = status + status.updater = (updater + 1) % 999999 + if (!animationHandler) return + clearTimeout(animationHandler) + } + + function emitEvent(type, ri, ci, row, cell) { + emit(type, ri, ci, row, cell) + } + + const clickHandler = (type, ri, ci, row, cell) => { + if (props.clickHighlight) { + status.rows.forEach((item, index) => { + if (index === ri) { + item[''isHighlight''] = true + } else { + item[''isHighlight''] = false + } + }) + } + emit(type, ri, ci, row, cell) + } + + function updateRows(rows, animationIndex) { + const { mergedConfig, animationHandler } = { + ...mergedConfig, + data: [...rows], + } + + status.needCalc = true + + if (typeof animationIndex === ''number'') status.animationIndex = animationIndex + if (!animationHandler) animation(true) + } + + watch(() => props.config, () => { + stopAnimation() + status.animationIndex = 0 + calcData() + }, { deep: true }) + + watch(() => props.highlightNumber, (num) => { + if (props.enableCarousel) { + if (num > -1) { + status.animationIndex = num; + animation(false); + if (status.rows.length <= props.config.rowNum) { + status.rows.forEach((row, index) => { + if (index === num) { + row.isHighlight = true + } else { + row.isHighlight = false + } + }) + } else { + status.rows.forEach((row, index) => { + if (index === 0) { + row.isHighlight = true + } else { + row.isHighlight = false + } + }) + } + stopAnimation(); + setTimeout(() => { + stopAnimation(); + animation(true); + }, 3000) + } + } else { + const rows = document.querySelectorAll(''.bv-scroll-table .rows .row-item''); + if (rows[num]) { + rows[num].scrollIntoView(); + status.rows.forEach((row, index) => { + if (index === num) { + row.isHighlight = true + } else { + row.isHighlight = false + } + }) + } + } + }) + + const moveHandler = (e) => { + const target = e.target; + const insideTable = target.closest(''.bv-scroll-table''); + if (!insideTable) { + const tooltip = document.querySelector(''.scroll-table-tooltip''); + if (tooltip) { + tooltip.remove(); + } + } + } + + const handleMove = window._.debounce(function (e, ri, ci, row, cell) { + const x = e.pageX; + const y = e.pageY; + const offsetWidth = e.target.offsetWidth; + const scrollWidth = e.target.scrollWidth; + if (offsetWidth < scrollWidth) { + const tooltip = document.querySelector(''.scroll-table-tooltip''); + if (!tooltip) { + const span = document.createElement(''span''); + span.className = ''scroll-table-tooltip''; + span.innerHTML = cell.val || cell; + span.style.top = y + 10 + ''px''; + span.style.left = x + 15 + ''px''; + document.body.appendChild(span); + } else { + tooltip.innerHTML = cell.val || cell; + tooltip.style.top = y + 10 + ''px''; + tooltip.style.left = x + 15 + ''px''; + } + } else { + const tooltip = document.querySelector(''.scroll-table-tooltip''); + tooltip && tooltip.remove(); + } + }, 200) + + onMounted(() => { + document.body.addEventListener(''mousemove'', moveHandler) + }) + + onUnmounted(() => { + stopAnimation(); + document.body.removeEventListener(''mousemove'', moveHandler) + }) + + const getCellContent = (cell) => { + if (typeof cell === ''object'') { + return cell.val + } else { + return cell + } + } + + return { + defaultConfig, + ...toRefs(status), + domRef, + width, + height, + resize, + updateRows, + handleHover, + onResize, + emitEvent, + clickHandler, + handleMove, + getCellContent, + } + } +} + +const defaultHeader = [''列1'', ''列2'', ''列3''] +const defaultDatas = [ + [''行1列1'', ''行1列2'', ''行1列3''], + [''行2列1'', ''行2列2'', ''行2列3''], + [''行3列1'', ''行3列2'', ''行3列3''], + [''行4列1'', ''行4列2'', ''行4列3''], + [''行5列1'', ''行5列2'', ''行5列3''], + [''行6列1'', ''行6列2'', ''行6列3''], + [''行7列1'', ''行7列2'', ''行7列3''], + [''行8列1'', ''行8列2'', ''行8列3''], + [''行9列1'', ''行9列2'', ''行9列3''], + [''行10列1'', ''行10列2'', ''行10列3''] +] + +class CustomScrollTableNode extends HtmlResize.view { + headerDatas = defaultHeader + tableDatas = defaultDatas + oldProperties = {} + chartRendered = false + historyDatas = [] + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { graphModel, model } = this.props; + const { properties, width, height, } = this.props.model; + const { + rowNum, headerBGC, oddRowBGC, evenRowBGC, waitTime, headerHeight, columnWidth, + align, index, carousel, hoverPause, fontColor, headerFontColor, oddRowGradBG, evenRowGradBG, + enableBorder, borderColor, enableCarousel, fontSize, headerFontSize, onlyHeaderHoriBorder, + onlyOuterBorder, onlyHeaderBorder, onlyBodyBorder, bodyBorderStyle, onlyHoriBorder, tableBGC, + clickHighlight, highlightBGC, highlightGradBG, highlightNumber, highlightFontColor } = properties; + const alignData = align.map(i => i.align); + const colWidths = columnWidth.map(i => i.colW); + + const clickHandler = (ri, ci, row, cell) => { + graphModel.eventCenter.emit("node:change", { + data: model, + e: { + ri, ci, row, cell + }, + }); + } + + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + onClick: clickHandler, + config: { + header: this.headerDatas, + data: this.tableDatas, + rowNum, + waitTime: parseInt(waitTime), + headerBGC, + oddRowBGC: oddRowBGC || oddRowGradBG, + evenRowBGC: evenRowBGC || evenRowGradBG, + headerHeight, + columnWidth: colWidths, + align: alignData, + index, carousel, + hoverPause, + }, + containerWidth: width, + containerHeight: height, clickHighlight, highlightBGC, highlightGradBG, highlightNumber, highlightFontColor, + fontColor, headerFontColor, enableBorder, borderColor, enableCarousel, fontSize, headerFontSize, + onlyOuterBorder, onlyHeaderBorder, onlyBodyBorder, bodyBorderStyle, onlyHoriBorder, onlyHeaderHoriBorder, tableBGC + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + el.style.height = ''100%''; + const instance = createVNode(ScrollTable, { + name: properties.nodeAlias, + onClick: clickHandler, + config: { + header: this.headerDatas, + data: this.tableDatas, + rowNum, + waitTime: parseInt(waitTime), + headerBGC, + oddRowBGC: oddRowBGC || oddRowGradBG, + evenRowBGC: evenRowBGC || evenRowGradBG, + headerHeight, + columnWidth: colWidths, + align: alignData, + index, carousel, + hoverPause, + }, + containerWidth: width, + containerHeight: height, clickHighlight, highlightBGC, highlightGradBG, highlightNumber, highlightFontColor, + fontColor, headerFontColor, enableBorder, borderColor, enableCarousel, fontSize, headerFontSize, + onlyOuterBorder, onlyHeaderBorder, onlyBodyBorder, bodyBorderStyle, onlyHoriBorder, onlyHeaderHoriBorder, tableBGC + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + filterDatasByGroup(datas, attrs) { + let headers = []; + let tableDatas = []; + if (datas.length > 0) { + headers = [''物编码'', ''物属性'', ''时间'', ''值'', ''单位'']; + const datasGrouped = window._.groupBy(datas, ''attrKey''); + const unitMap = {}; + for (const key in attrs) { + unitMap[key] = attrs[key].unit; + } + for (const key in datasGrouped) { + const serieData = datasGrouped[key]; + serieData.forEach(i => { + const time = window.dayjs(Number(i.ts)).format(''YYYY-MM-DD HH:mm:ss''); + tableDatas.push([i.thingCode, i.attrKey, time, i.val, unitMap[i.attrKey] || '''']) + }) + } + this.headerDatas = headers; + this.tableDatas = tableDatas; + } + } + + filterHistoryData(thingCodeArr, totalAttrs, dataPointArr, apiid, renderIntervalEnabled) { + if (dataPointArr && dataPointArr.length > 0) { + let datas = [] + if (renderIntervalEnabled) { + datas = window.totalHistoryDatas[apiid]; + } else { + datas = window.globalDashboardDatas[apiid].values; + } + if (datas && datas.length > 0) { + const gotValues = datas.filter((val) => thingCodeArr.includes(val.thingCode) && dataPointArr.includes(val.attrKey)) + this.filterDatasByGroup(gotValues, totalAttrs) + this.chartRendered = true; + } + } + } + + renderEmpty(properties) { + const { emptyTable, colNum, rowNum } = properties; + if (emptyTable != undefined && emptyTable) { + // 渲染空表格 + this.headerDatas = new Array(colNum).fill(''''); + this.tableDatas = new Array(rowNum * 2).fill('''').map(() => this.headerDatas.slice()); + } else { + this.headerDatas = defaultHeader; + this.tableDatas = defaultDatas; + } + this.chartRendered = true; + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { apiid } = properties; + const { normalData } = properties.dynamic || {}; + const { dataPointArr, thingCodeArr, customApiDatas, enableTestDatas, testDatas } = normalData || {} + let totalAttrs = {} + if (normalData && normalData.dataPoint) { + if (window.isJSON(normalData.dataPoint)) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { attrs } = dataPointStrParsed; + totalAttrs = attrs; + } + } + + if (!dataPointArr || (dataPointArr && dataPointArr.length === 0)) { + this.renderEmpty(properties); + } + + // 如果采用来自自定义数据源的数据 + if (customApiDatas) { + this.headerDatas = customApiDatas.headerDatas || defaultHeader; + this.tableDatas = customApiDatas.tableDatas || defaultDatas; + this.chartRendered = true; + } + + if (enableTestDatas && testDatas) { + const fn = new Function('''', testDatas); + const ret = fn(); + if (ret && ret.headerDatas && ret.tableDatas) { + this.headerDatas = ret.headerDatas; + this.tableDatas = ret.tableDatas; + this.chartRendered = true; + } + } + + const propertiesBack = window._.cloneDeep(properties); + // 由于事件change 会给properties 增加一个 event 属性(见目录scadaDashboard/Diagram/useDynamicEventsHandler),会引发属性的改变,导致组件重渲染。 + delete propertiesBack.event; + if (propertiesBack.dynamic.normalData) { + propertiesBack.dynamic.normalData.defaultValue = ''''; + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (dataPointArr && apiid && !this.chartRendered) { + this.filterHistoryData(thingCodeArr, totalAttrs, dataPointArr, apiid, normalData.renderIntervalEnabled); + return true; + } + } + return true + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + const { renderInterval, dataPointArr, thingCodeArr } = normalData || {}; + let totalAttrs = {} + if (normalData && normalData.dataPoint) { + if (window.isJSON(normalData.dataPoint)) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { attrs } = dataPointStrParsed; + totalAttrs = attrs; + } + } + + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + + let inters = parseInt(renderInterval || ''300000'') + if (normalData && !normalData.renderIntervalEnabled) { + inters = 1000 + } + setInterval(() => { + if (window.totalHistoryDatas && window.totalHistoryDatas[properties.apiid]) { + this.filterHistoryData(thingCodeArr, totalAttrs, dataPointArr, properties.apiid, normalData.renderIntervalEnabled); + this.setHtml(this.rootEl); + } + }, inters) + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class CustomScrollTableModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''custom-scrolltable-node'', + view: CustomScrollTableNode, + model: CustomScrollTableModel, +})', '', 1001, NULL, 1699972072580583400, 1067246875800000001, 1703498148712, 1067246875800000001, 1721286640514, 't', '时序', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612583616514, 'custom-hexagon-node', '六边形', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","min":0,"precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","editorState":"default"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "0c85e649-7f5f-4fc0-9e4e-6a591848c8f7", + "type": "custom-hexagon-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "0c85e649-7f5f-4fc0-9e4e-6a591848c8f7", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "六边形", + "fill": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3, + "dataPoint": "" + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 六边形 +class HexagonModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class HexagonView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.28 * width, y - 0.5 * height], + [x + 0.28 * width, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.28 * width, y + 0.5 * height], + [x - 0.28 * width, y + 0.5 * height], + [x - 0.5 * width, y] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} + +lf.register({ + type: ''custom-hexagon-node'', + view: HexagonView, + model: HexagonModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148462, 1067246875800000001, 1721286640717, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612688474113, 'custom-times-node', '乘号', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "04506d07-5c5f-4a65-923a-405ab2b30451", + "type": "custom-times-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "04506d07-5c5f-4a65-923a-405ab2b30451", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "乘号", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 乘号 +class TimesModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class TimesView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 3 * height], + [x - 1 / 3 * width, y - 1 / 2 * height], + [x, y - 1 / 6 * height], + [x + 1 / 3 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 3 * height], + [x + 1 / 6 * width, y], + [x + 1 / 2 * width, y + 1 / 3 * height], + [x + 1 / 3 * width, y + 1 / 2 * height], + [x, y + 1 / 6 * height], + [x - 1 / 3 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 3 * height], + [x - 1 / 6 * width, y], + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} +lf.register({ + type: ''custom-times-node'', + view: TimesView, + model: TimesModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148492, 1067246875800000001, 1721286641146, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102614580105217, 'custom-pentagon-node', '五边形', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "82d8317f-dc96-4aac-a534-29fa164d6deb", + "type": "custom-pentagon-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "82d8317f-dc96-4aac-a534-29fa164d6deb", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "五边形", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 五边形 +class PentagonModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + }; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class PentagonView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.5 * width, y], + [x, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.3 * width, y + 0.5 * height], + [x - 0.3 * width, y + 0.5 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} + +lf.register({ + type: ''custom-pentagon-node'', + view: PentagonView, + model: PentagonModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148937, 1067246875800000001, 1721286641313, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (109414856064593920, 'vertical-capsule-tank', '垂直胶囊水箱', 1655394372066877442, ' + + + + + + + + + + + + + + + + + + + +', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","mode":"horizontal","format":"rgba","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}]},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "c80c2bf8-4b01-404c-a677-fe21efed0615", + "type": "vertical-capsule-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "c80c2bf8-4b01-404c-a677-fe21efed0615", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": true, + "unitColor": "rgba(74, 144, 226, 1)", + "nodeAlias": "垂直胶囊水箱", + "showDefaultValue": false, + "fontSize": 12, + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const VerticalCapsuleTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(39 - (realValue / maxValue * 85)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class VerticalCapsuleTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(VerticalCapsuleTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class VerticalCapsuleTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''vertical-capsule-tank'', + view: VerticalCapsuleTankNode, + model: VerticalCapsuleTankModel, +}) + +', '', 1001, 1001, 1001, 1067246875800000001, 1706498194515, 1067246875800000001, 1721804057050, 't', '时间', 'f', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102613946765314, 'custom-line-chart', '折线图', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"radios","label":"渲染模式","name":"renderMode","options":[{"label":"canvas","value":"canvas"},{"label":"svg","value":"svg"}],"id":"u:047a1336613a","mode":"horizontal"},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"布局","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"grid","columns":[{"body":[{"type":"input-text","label":"左边距","name":"grid.left","id":"u:1778e7d54c41","mode":"horizontal","size":"full"}],"id":"u:720608fd274b"},{"body":[{"type":"input-text","label":"右边距","name":"grid.right","id":"u:41e8804639dd","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:175b96654696","mode":"horizontal","size":"full"}]}],"id":"u:fb776ace0e8b"}],"id":"u:aea0c21b7ba2","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"上边距","name":"grid.top","id":"u:8f1e65861eca","mode":"horizontal","size":"full"}],"id":"u:97a259e6edde"},{"body":[{"type":"input-text","label":"下边距","name":"grid.bottom","id":"u:1774c755f248","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:e1d3e5e47502","mode":"horizontal","size":"full"}]}],"id":"u:4699288ff76c"}],"id":"u:a580952c96bd","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"背景","name":"grid.backgroundColor","id":"u:f398c821eda1","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"背景","inputClassName":"w-full"}],"id":"u:e14008b58dcb"},{"body":[{"type":"switch","label":"显示","option":"","name":"grid.show","falseValue":false,"trueValue":true,"id":"u:97eb082723ff","value":false,"mode":"horizontal"}],"id":"u:a013d4bd2004"}],"id":"u:94acb2282c6c","className":"m-b"}],"style":{"position":"static","display":"block"},"data":{"grid":{}},"wrapperBody":false}],"bodyClassName":"m-b"},{"type":"fieldset","id":"u:0685657fe4bc","className":"","title":"标题","collapsable":true,"body":[{"type":"container","id":"u:73fcc93013bb","body":[{"type":"grid","columns":[{"body":[{"type":"input-text","label":"文本","name":"title.text","id":"u:367bcfaf236d","mode":"horizontal"}],"id":"u:bcea4c8a21d2"},{"body":[{"type":"switch","label":"显示","option":"","name":"title.show","falseValue":false,"trueValue":true,"id":"u:67b9b8292560","value":false,"mode":"horizontal"}],"id":"u:2e8f807025d3"}],"id":"u:5fafefdb95b3","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"左边距","name":"title.left","id":"u:c0774249b76c","mode":"horizontal","size":"full"}],"id":"u:ce7604a06386"},{"body":[{"type":"input-text","label":"右边距","name":"title.right","id":"u:ba7437e94ec2","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:115359876c6b","mode":"horizontal","size":"full"}]}],"id":"u:0b1a46c451fb"}],"id":"u:d5f5d7d1f821","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"上边距","name":"title.top","id":"u:26039411388d","mode":"horizontal","size":"full"}],"id":"u:f02a179a6a50"},{"body":[{"type":"input-text","label":"下边距","name":"title.bottom","id":"u:54a0ef638b7d","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:65d1107ed8b8","mode":"horizontal","size":"full"}]}],"id":"u:1989abb0a053"}],"id":"u:aa3c4bbe6aa5","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"data":{"title":{}}},{"type":"fieldset","id":"u:4a7ac0579e1c","title":"字体","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"title.textStyle.color","id":"u:570bce4701ea","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:3b84bfb2ac84"},{"body":[{"type":"input-number","label":"大小","name":"title.textStyle.fontSize","keyboard":true,"id":"u:e4036200c979","step":1,"mode":"horizontal"}],"id":"u:fa52ed3d81ae"}],"id":"u:47c4b60e2f0a"}],"id":"u:26e7e01f73a1"}],"id":"u:1f93884d7cab"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:94fc9c2c1ee3","data":{"textStyle":{}}}],"bodyClassName":""}],"bodyClassName":"m-b","headingClassName":""},{"type":"fieldset","id":"u:a0a8c50d2f9c","className":"","title":"图例","collapsable":true,"body":[{"type":"container","id":"u:5af0a6740a48","body":[{"type":"grid","columns":[{"body":[{"type":"input-text","label":"左边距","name":"legend.left","id":"u:0228dee14f3e","mode":"horizontal","size":"full","placeholder":"","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"输入:auto, 20, 20%, 或, ''left'', ''center'', ''right''"}}],"id":"u:ffb4d6853cbb"},{"body":[{"type":"input-text","label":"右边距","name":"legend.right","id":"u:99d884571158","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:9048b9fc654f","mode":"horizontal","size":"full"}],"placeholder":"","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"输入:auto, 20, 20%"}}],"id":"u:5b434cc50594"}],"id":"u:254dccfe46f5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"上边距","name":"legend.top","id":"u:3efa5a6f1d46","mode":"horizontal","size":"full","placeholder":"","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"输入:auto, 20, 20%, 或, ''top'', ''middle'', ''bottom''"}}],"id":"u:79668537c91d"},{"body":[{"type":"input-text","label":"下边距","name":"legend.bottom","id":"u:6030173b41b3","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:c035f176036c","mode":"horizontal","size":"full"}],"placeholder":"","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"输入:auto, 20, 20%"}}],"id":"u:e9f3fe39e864"}],"id":"u:211aaa4653cc","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"select","label":"布局","name":"legend.orient","options":[{"label":"横向布局","value":"horizontal"},{"label":"纵向布局","value":"''vertical''"}],"id":"u:a18ac2f33143","multiple":false,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:5e71ee86aec4"},{"body":[{"type":"switch","label":"显示图例","option":"","name":"legend.show","falseValue":false,"trueValue":true,"id":"u:25bc165dc563","value":false,"mode":"horizontal"}],"id":"u:90592ff9b2a3"}],"id":"u:49360f5a1bcb","className":"m-b"},{"type":"fieldset","id":"u:272913f05159","title":"字体","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"legend.textStyle.color","id":"u:ddd5a5134e19","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:b2df858e74f3"},{"body":[{"type":"input-number","label":"大小","name":"legend.textStyle.fontSize","keyboard":true,"id":"u:eec3185223ca","step":1,"mode":"horizontal"}],"id":"u:865c3447f663"}],"id":"u:5de46ec9b165"}],"id":"u:dfbc505ddf7a"}],"id":"u:36dd156f03e5"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:265de21133fd","data":{"textStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"data":{"legend":{}},"wrapperBody":false}],"bodyClassName":"","headingClassName":""},{"type":"fieldset","id":"u:2321d062ada5","className":"","title":"提示框","collapsable":true,"body":[{"type":"container","id":"u:3661446fb8ad","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"tooltip.show","falseValue":false,"trueValue":true,"id":"u:8df1faada29d","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:8a7218821e27"},{"body":[{"type":"input-color","label":"背景","name":"tooltip.backgroundColor","id":"u:b3a6408a8dae","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full"}],"id":"u:7b83edc11d08"}],"id":"u:eda33b0d0f98","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"select","label":"触发","name":"tooltip.trigger","options":[{"label":"数据项触发","value":"item"},{"label":"坐标轴触发","value":"axis"}],"id":"u:fd2fa797125e","multiple":false,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:da210f3ca364"},{"body":[{"type":"switch","label":"显示内容","option":"","name":"tooltip.showContent","falseValue":false,"trueValue":true,"id":"u:902a4a22cdfc","value":false,"mode":"horizontal"}],"id":"u:824cae55e184"}],"id":"u:2730c1b6116e","className":"m-b"},{"type":"grid","id":"u:5300fcaff465","columns":[{"body":[{"type":"input-color","label":"边色","name":"tooltip.borderColor","id":"u:c2f4d40b92ed","format":"rgba","mode":"horizontal","inputClassName":"w-full myColorPick"}],"id":"u:a25f8b35520a"},{"body":[{"type":"input-number","label":"边宽","name":"tooltip.borderWidth","keyboard":true,"id":"u:5e4fdc86abc5","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:1d06c49dbc3c"}],"className":"m-b"},{"type":"fieldset","id":"u:b8ee82cc2eb9","title":"字体","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"tooltip.textStyle.color","id":"u:70c1fbf4672f","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:ae2f495b3764"},{"body":[{"type":"input-number","label":"大小","name":"tooltip.textStyle.fontSize","keyboard":true,"id":"u:72ceba01a7cc","step":1,"mode":"horizontal"}],"id":"u:33cec15972d4"}],"id":"u:2526fcd05096"}],"id":"u:6922018dd6d1"}],"id":"u:7e7d67ef7752"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:6c0348f13581","data":{"textStyle":{}}}],"bodyClassName":""}],"id":"u:47aacf20a627"}],"id":"u:3749f665c04b","className":"m-b"}],"style":{"position":"static","display":"block"},"data":{"tooltip":{}},"wrapperBody":false}],"bodyClassName":""},{"type":"fieldset","id":"u:3a48dd399109","className":"","title":"x坐标轴","collapsable":true,"body":[{"type":"input-text","id":"u:abb02410fd1c","label":"坐标轴名称","name":"xAxis.name","mode":"horizontal"},{"type":"input-color","label":"名称颜色","name":"xAxis.nameColor","id":"u:b900d1025127","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"container","id":"u:eefe19817538","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"xAxis.show","falseValue":false,"trueValue":true,"id":"u:2096af8308a3","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:4eef8d1cc676"}],"id":"u:ea0f62118b56","className":"m-b"},{"type":"fieldset","id":"u:907187f7e2a1","title":"x轴线","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"x轴轴线显示","option":"","name":"xAxis.axisLine.show","falseValue":false,"trueValue":true,"id":"u:71b59c2bed70","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:118aba12cec1","title":"x轴轴线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"xAxis.axisLine.lineStyle.color","id":"u:8ed5e076ca5c","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:55813e1f8142"},{"body":[{"type":"input-number","label":"宽度","name":"xAxis.axisLine.lineStyle.width","keyboard":true,"id":"u:41934b04ff67","step":1,"mode":"horizontal"}],"id":"u:d7abe8fad5ca"}],"id":"u:893ab7d1ed57"}],"id":"u:227994a18fe9"}],"id":"u:6262674c1c5c"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:85847be141b3","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:92c4666bcef8","data":{"axisLine":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:75c8b571aac0","title":"x轴刻度","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"显示","option":"","name":"xAxis.axisTick.show","falseValue":false,"trueValue":true,"id":"u:fd9e421b00ca","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:0fd48ddb098a","title":"x轴刻度风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"xAxis.axisTick.lineStyle.color","id":"u:e5fca7b0b79b","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:f9e6ec4896c4"},{"body":[{"type":"input-number","label":"宽度","name":"xAxis.axisTick.lineStyle.width","keyboard":true,"id":"u:1571934a432c","step":1,"mode":"horizontal"}],"id":"u:17179e81c729"}],"id":"u:ef9eaed28557"}],"id":"u:d9f5024d9671"}],"id":"u:1b3520d785a5"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:e7dfac0e99fd","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:19673ccefa01","data":{"axisTick":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:20a14bb0f788","title":"x轴标签","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"xAxis.axisLabel.color","id":"u:caf5a900530e","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:cd95dc526524"},{"body":[{"type":"input-number","label":"大小","name":"xAxis.axisLabel.fontSize","keyboard":true,"id":"u:21b8c8b2b0ae","step":1,"mode":"horizontal"}],"id":"u:6db43f6de611"}],"id":"u:b098a9ec59df","className":"m-b-xs"},{"type":"switch","label":"显示","option":"","name":"xAxis.axisLabel.show","falseValue":false,"trueValue":true,"id":"u:1d7c622a336f","value":false,"mode":"horizontal","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:86e6b7d652a0","data":{"axisLabel":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:a1e52778791f","title":"x轴分割线","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"x轴分割线显示","option":"","name":"xAxis.splitLine.show","falseValue":false,"trueValue":true,"id":"u:e95df5c45a7e","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:66c502dea7a7","title":"x轴分割线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"xAxis.splitLine.lineStyle.color","id":"u:3a618618dae0","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:f46d328a3f22"},{"body":[{"type":"input-number","label":"宽度","name":"xAxis.splitLine.lineStyle.width","keyboard":true,"id":"u:a3ee7bf1223d","step":1,"mode":"horizontal"}],"id":"u:309b42de5f47"}],"id":"u:7c58df9998ec"}],"id":"u:8dd911474f86"}],"id":"u:824a429f7da1"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:6aa6764ef192","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:3a6bddcca5ee","data":{"splitLine":{}}}],"bodyClassName":""}],"id":"u:a8e29911a8e3"}],"id":"u:78f1615eb5a3","className":"m-b"}],"style":{"position":"static","display":"block"},"data":{"xAxis":{}},"wrapperBody":false}],"bodyClassName":""},{"type":"fieldset","id":"u:f9aa35a53b3c","className":"","title":"y坐标轴","collapsable":true,"body":[{"type":"container","id":"u:180e8b28f9fa","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"yAxis.show","falseValue":false,"trueValue":true,"id":"u:c4ef30d500dc","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:8eea96d4f12d"}],"id":"u:acc7e6a4e520","className":"m-b"},{"type":"fieldset","id":"u:ce9d777193df","title":"y轴线","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"y轴轴线显示","option":"","name":"yAxis.axisLine.show","falseValue":false,"trueValue":true,"id":"u:634fa0ea84a5","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:6a2865630e68","title":"y轴轴线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"yAxis.axisLine.lineStyle.color","id":"u:aea16c2c7a84","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:4a754fe50e08"},{"body":[{"type":"input-number","label":"宽度","name":"yAxis.axisLine.lineStyle.width","keyboard":true,"id":"u:290a931d904f","step":1,"mode":"horizontal"}],"id":"u:86515517aa68"}],"id":"u:5529505abbd4"}],"id":"u:219a49a719e6"}],"id":"u:ad675db55c48"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:68d3d781451b","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:1be7f231b28e","data":{"axisLine":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:3fdec5dec631","title":"y轴刻度","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"显示","option":"","name":"yAxis.axisTick.show","falseValue":false,"trueValue":true,"id":"u:58e04faa3c92","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:f18f86b00d5d","title":"y轴刻度风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"yAxis.axisTick.lineStyle.color","id":"u:be3f5eee553c","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:7bcc36e22821"},{"body":[{"type":"input-number","label":"宽度","name":"yAxis.axisTick.lineStyle.width","keyboard":true,"id":"u:e04f3f6f2cc3","step":1,"mode":"horizontal"}],"id":"u:4ba5d2e1ea07"}],"id":"u:6440d669f360"}],"id":"u:ad68ce859a7c"}],"id":"u:4a7d06fdb2b4"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:b25293793d7f","data":{"lineStyle":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:93bd4fed48ff","title":"y轴标签","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"yAxis.axisLabel.color","id":"u:7fa26ddc1ab5","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:fd3336725b84"},{"body":[{"type":"input-number","label":"大小","name":"yAxis.axisLabel.fontSize","keyboard":true,"id":"u:65037a8397ee","step":1,"mode":"horizontal"}],"id":"u:d5b399f13ea4"}],"id":"u:95ad7678203e","className":"m-b-xs"},{"type":"switch","label":"显示","option":"","name":"yAxis.axisLabel.show","falseValue":false,"trueValue":true,"id":"u:7cb8264230b1","value":false,"mode":"horizontal","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:95667fb0c244","data":{"axisLabel":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:c845c3a67039","data":{"axisTick":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:0a1a84201903","title":"y轴分割线","collapsable":true,"body":[{"type":"container","body":[{"type":"switch","label":"y轴分割线显示","option":"","name":"yAxis.splitLine.show","falseValue":false,"trueValue":true,"id":"u:caa3b966e95b","value":false,"mode":"horizontal","className":"m-b"},{"type":"fieldset","id":"u:97085338bd02","title":"y轴分割线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"yAxis.splitLine.lineStyle.color","id":"u:729dbec8be7c","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:18f6ccdafb5f"},{"body":[{"type":"input-number","label":"宽度","name":"yAxis.splitLine.lineStyle.width","keyboard":true,"id":"u:8c714596c1b2","step":1,"mode":"horizontal"}],"id":"u:d0cd18f6138e"}],"id":"u:d0902c0487aa"}],"id":"u:2bed8554fd13"}],"id":"u:5356527017b0"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:b4e230155075","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:e2ba52918887","data":{"splitLine":{}}}],"bodyClassName":""}],"id":"u:a9fe7db6d069"}],"id":"u:40507e55fde2","className":"m-b"}],"style":{"position":"static","display":"block"},"data":{"yAxis":{}},"wrapperBody":false}],"bodyClassName":""},{"type":"fieldset","title":"代码配置","collapsable":true,"body":[{"type":"editor","label":"function (option, datas, instance) {","name":"codeConfig","id":"u:689625dc5d7d","language":"javascript","value":"return option","labelClassName":"text-left","inputClassName":"text-left","className":"m-b-xs"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:f533d43d9ee4","className":"m-t-xs p-t-xs"}],"id":"u:cf0267c9669d","headingClassName":""}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true,"actions":[]}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"},{"type":"input-number","label":"渲染间隔","name":"renderInterval","keyboard":true,"id":"u:3f7cb08b0e2b","step":1,"mode":"horizontal","unitOptions":["ms"],"min":30000,"labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"最低渲染间隔为30秒","title":"提示:"}},{"type":"switch","label":"开启渲染间隔","option":"","name":"renderIntervalEnabled","falseValue":false,"trueValue":true,"id":"u:9486003439ac","value":true,"mode":"horizontal","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"关闭渲染间隔,将会渲染socket 推送的实时数据,意味着此时配置的数据源api如果不是 “最新” 值,将不会渲染。并且关闭渲染间隔后,需保存并刷新看板,才能看到效果。","title":"提示:"}},{"type":"select","label":"时间轴格式化","name":"timeAxisFormatter","options":[{"label":"时","value":"HH"},{"label":"时分","value":"HH:mm"},{"label":"日","value":"DD"},{"label":"日 时分","value":"DD HH:mm"},{"label":"月","value":"MM"},{"label":"月日","value":"MM-DD"},{"label":"月日时分","value":"MM-DD HH:mm"}],"id":"u:362d1b26c7f0","multiple":false,"mode":"horizontal","inputClassName":"w-full","clearable":true},{"type":"switch","label":"补全数据","option":"","name":"completeDatas","falseValue":false,"trueValue":true,"id":"u:ce012e34fcb6","value":false,"mode":"horizontal","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"补齐一个时间区间内没有的数据"}},{"type":"select","label":"时间对比","name":"timeCompare","options":[{"label":"今日-昨日","value":"day"},{"label":"当月-上月","value":"month"},{"label":"今年-去年","value":"year"}],"id":"u:12f8f50a7559","mode":"horizontal","inputClassName":"w-full","clearable":true,"labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"用于时间区间,例如【两日、两月、两年】等的【对比分析】场景"},"visibleOn":"this.completeDatas","multiple":false},{"type":"radios","label":"数据展示","name":"dataShowTypes","options":[{"label":"单个物单个属性","value":"oneThingOneAttr"},{"label":"单个物多个属性","value":"oneThingManyAttr"},{"label":"多个物多个属性","value":"manyThingManyAttr"},{"label":"多个物一个属性","value":"manyThingOneAttr"}],"id":"u:b8aeecd9e52f","mode":"horizontal","inputClassName":"w-full","itemClassName":"w-full","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"请确保数据点的选择与数据展示方式一致"},"onEvent":{"change":{"actions":[{"componentId":"u:0fc48eacd2a4","actionType":"setValue","args":{"value":""}}]}}},{"type":"select","label":"图例名称展示","name":"legendNameType","options":[{"label":"物名称","value":"thingName","disabledOn":"this.dataShowTypes === ''oneThingManyAttr'' || this.dataShowTypes === ''manyThingManyAttr'' "},{"label":"物编码","value":"thingCode","disabledOn":"this.dataShowTypes === ''oneThingManyAttr'' || this.dataShowTypes === ''manyThingManyAttr''"},{"label":"属性名称","value":"attrName","disabledOn":"this.dataShowTypes === ''manyThingManyAttr'' || this.dataShowTypes === ''manyThingOneAttr''"},{"label":"属性编码","value":"attrCode","disabledOn":"this.dataShowTypes === ''manyThingManyAttr'' || this.dataShowTypes === ''manyThingOneAttr''"},{"label":"物名称 + 属性名称","value":"thingNameAttrName"},{"label":"物编码 + 属性编码","value":"thingCodeAttrCode"}],"id":"u:0fc48eacd2a4","multiple":false,"mode":"horizontal","inputClassName":"w-full","value":"attrName"},{"type":"switch","label":"自定义数据源","option":"","name":"customDatasource","falseValue":false,"trueValue":true,"id":"u:648ca964f693","value":false,"mode":"horizontal"},{"type":"input-text","label":"数据源api","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"visibleOn":"this.customDatasource"},{"type":"radios","label":"请求方式","name":"requestMethod","options":[{"label":"get 请求","value":"get"},{"label":"post 请求","value":"post"}],"id":"u:2c48207f4f65","mode":"horizontal","visibleOn":"this.customDatasource","value":"get"},{"type":"editor","label":"请求入参","name":"requestParams","id":"u:e94982b03d0c","language":"javascript","value":"return {};","visibleOn":"this.customDatasource","inputClassName":"","className":"text-left"},{"type":"editor","label":"数据过滤","name":"dataFilterFn","id":"u:f9ef754971e0","language":"javascript","value":"// datas 数据处理\n// ....\n","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"入参api返回数据: datas"},"labelClassName":"text-left","inputClassName":"text-left","options":{"lineNumbers":"off"},"visibleOn":"this.customDatasource"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true},{"url":"./plugins/echarts.min.js","isModule":false,"disabled":false}]', '{ + "nodes": [ + { + "id": "a3c0bb09-4bc9-4717-8adc-ff83e5eee086", + "type": "custom-line-chart", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "a3c0bb09-4bc9-4717-8adc-ff83e5eee086", + "width": 350, + "height": 250, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "grid": { + "show": false, + "top": "25", + "left": "30", + "right": "5", + "bottom": "20", + "backgroundColor": "" + }, + "title": { + "show": true, + "padding": "", + "left": "30", + "right": "2", + "top": "2", + "bottom": "2", + "text": "kWh", + "textAlign": "auto", + "textVerticalAlign ": "middle" + }, + "legend": { + "show": true, + "orient": "horizontal", + "left": "center", + "top": "" + }, + "tooltip": { + "show": true, + "showContent": true, + "trigger": "axis" + }, + "xAxis": { + "show": true, + "axisLine": { + "show": true + }, + "axisTick": { + "show": true + }, + "axisLabel": { + "show": true, + "fontSize": 12 + }, + "splitLine": { + "show": false + }, + "type ": "category", + "name": "", + "nameColor": "" + }, + "yAxis": { + "show": true, + "axisLine": { + "show": true + }, + "axisTick": { + "show": true + }, + "axisLabel": { + "show": true, + "fontSize": 12 + }, + "splitLine": { + "show": false + }, + "type ": "value" + }, + "codeConfig": "option.color = [''#80FFA5'', ''#00DDFF'', ''#37A2FF'', ''#FF0087'', ''#FFBF00''];\r\n\r\n// 值保留为两位小数。\r\noption.valueFormatter = (value) => {\r\n if (typeof value === ''number'') {\r\n return value.toFixed(2);\r\n } else {\r\n return value\r\n }\r\n};\r\n\r\noption.series.forEach((item) => {\r\n // item.stack = \"total\";\r\n item.smooth = \"true\";\r\n // 区域风格,可配置\r\n // item.areaStyle = {};\r\n // 线条风格, 可自定义\r\n item.lineStyle = {\r\n width: 1\r\n };\r\n});\r\nreturn option;", + "fontSize": 0, + "showDefaultValue": false, + "showUnit": false, + "nodeAlias": "折线图", + "renderMode": "canvas", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "", + "renderIntervalEnabled": true, + "completeDatas": false, + "legendNameType": "attrName", + "customDatasource": false, + "dataShowTypes": "oneThingManyAttr", + "timeAxisFormatter": "HH", + "requestMethod": "get", + "requestParams": "return {};", + "dataFilterFn": "// datas 数据处理\n// ....\n" + } + } + } + } + ] +}', '.custom-line-chart svg { + stroke: none; +}', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const timeArr = new Array(24).fill(''''); +const totals = []; +timeArr.forEach((i, index) => { const t = window.dayjs().hour(index).valueOf(); totals.push({ val: Math.random(1000) * 100, ts: t, attrKey: "A29" }) }); +timeArr.forEach((i, index) => { const t = window.dayjs().hour(index).valueOf(); totals.push({ val: Math.random(1000) * 100, ts: t, attrKey: "A8" }) }); +const defaultSocketValue = totals; + +const xAxisLabelFormatter = function (val) { + if (this.timeCompare) return; + if (this.timeAxisFormatter) { + return dayjs(+val).format(this.timeAxisFormatter); + } + const { months, days } = this; + if (months === 0 && days === 0) { + return dayjs(+val).format("HH:mm"); + } else if (months === 0 && days > 0) { + return dayjs(+val).format("DD HH:mm"); + } else if (months > 0 && days >= 0) { + return dayjs(+val).format("MM-DD HH:mm"); + } +}; + +// 工具提示格式化 +const tooltipFormatter = function (params) { + let strs = ""; + const timeFormatterMap = { + "HH": ''时'', + "DD": ''日'', + ''MM'': ''月'' + } + const time = this.timeCompare ? params[0].name : window.dayjs.unix(+params[0].name / 1000).format(this.timeAxisFormatter || "YYYY-MM-DD HH:mm:ss"); + strs += `
${time} ${timeFormatterMap[this.timeAxisFormatter] || ''''}
`; + params.forEach((param) => { + strs += param.marker + " " + param.seriesName + ":  " + Number(param.value).toFixed(2) + "
"; + }) + return strs; +}; + +// 图例格式化 +const assembleLegend = (api, thingKey, attrkey, dataShowTypes, legendNameType, datas) => { + if (api) { + const infos = window.totalDeviceInfos[api]; + if (!infos) return; + if (!datas[0]) return; + const thing = infos[datas[0].thingCode]; + if (!thing) return; + const thingName = thing.entityName; + const attrName = thing.attrs[attrkey].name; + if (dataShowTypes.value === ''oneThingOneAttr'') { + switch (legendNameType.value) { + case "thingName": + return thing.entityName; + case "thingCode": + return thingKey; + case "attrName": + return attrName; + case "attrCode": + return attrkey; + case "thingNameAttrName": + return thingName + ''-'' + attrName; + case "thingCodeAttrCode": + return thingKey + ''-'' + attrkey; + } + } else if (dataShowTypes.value === ''oneThingManyAttr'') { + switch (legendNameType.value) { + case "attrName": + return thing.attrs[attrkey].name; + case "attrCode": + return attrkey; + case "thingNameAttrName": + return thingName + ''-'' + attrName; + case "thingCodeAttrCode": + return thingKey + ''-'' + thingKey + } + } else if (dataShowTypes.value === ''manyThingManyAttr'') { + switch (legendNameType.value) { + case "thingNameAttrName": + const attrName = thing.attrs[attrKey].name + return thingName + ''-'' + attrName; + case "thingCodeAttrCode": + return thingKey + ''-'' + thingKey; + } + } else if (dataShowTypes.value === ''manyThingOneAttr'') { + switch (legendNameType.value) { + case "thingName": + return thingName; + case "thingCode": + return thingKey; + case "thingNameAttrName": + const attrName = thing.attrs[attrKey].name + return thingName + ''-'' + attrName; + case "thingCodeAttrCode": + return thingKey + ''-'' + thingKey; + } + } + } else { + return attrkey; + } +} + + +const LineChart = { + template: ''
'', + props: { + lineId: { + type: String, + default: '''' + }, + historyDatas: { + type: Array, + default: () => [] + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + grid: { + type: Object, + default: () => { } + }, + title: { + type: Object, + default: () => { } + }, + legend: { + type: Object, + default: () => { } + }, + tooltip: { + type: Object, + default: () => { } + }, + xAxis: { + type: Object, + default: () => { } + }, + yAxis: { + type: Object, + default: () => { } + }, + codeConfig: { + type: String, + default: '''' + }, + timeAxisFormatter: { + type: String, + default: '''' + }, + completeDatas: { + type: Boolean, + default: false + }, + totalTimes: { + type: Array, + default: () => [] + }, + timeCompare: { + type: String, + default: '''', + }, + dataShowTypes: { + type: String, + default: ''oneThingManyAttr'', + }, + legendNameType: { + type: String, + default: ''attrName'', + }, + apiid: { + type: String, + default: '''', + }, + renderMode: { + type: String, + default: ''canvas'', + } + }, + computed: { + getStyle() { + return { + width: `${this.width}px`, + height: `${this.height}px` + } + } + }, + setup(props) { + const { onMounted, nextTick, toRefs, watch } = Vue; + const { grid, title, legend, tooltip, xAxis, yAxis, historyDatas, codeConfig, timeAxisFormatter, completeDatas, totalTimes, timeCompare, dataShowTypes, legendNameType, apiid, renderMode } = toRefs(props) + + const tooltipFormatterBound = tooltipFormatter.bind({ timeCompare: timeCompare.value, timeAxisFormatter: timeAxisFormatter.value }); + let myChart = null; + let timeCompareMap = { + ''day'': { + prev: ''昨日'', + curr: ''今日'' + }, + ''month'': { + prev: ''上月'', + curr: ''当月'' + }, + ''year'': { + prev: ''去年'', + curr: ''今年'' + }, + } + const initChart = (datas) => { + // 基于准备好的dom,初始化echarts实例 + + const dom = document.getElementById(props.lineId); + if (dom && !myChart) { + myChart = echarts.init(dom, null, { + renderer: renderMode.value + }); + if (datas) { + let series = []; + let legends = []; + let xAxisData = []; + let xAxisLabelFormatterBound = null; + if (datas.length > 0) { + const thingGrouped = window._.groupBy(datas, ''thingCode''); + for (const thingKey in thingGrouped) { + const attrGrouped = window._.groupBy(thingGrouped[thingKey], ''attrKey'') + const keysLen = Object.keys(attrGrouped).length; + for (const key in attrGrouped) { + let serieData = attrGrouped[key]; + const legendKey = assembleLegend(apiid.value, thingKey, key, dataShowTypes, legendNameType, serieData); + legends.push(legendKey); + if (!xAxisLabelFormatterBound) { + const first = serieData[0]; + const last = serieData[serieData.length - 1]; + if (first.ts > last.ts) { + serieData = serieData.reverse() + } + const dayjs = window.dayjs; + const firstDay = dayjs(+first.ts); + const lastDay = dayjs(+last.ts); + const days = firstDay.diff(lastDay, ''day''); + const months = firstDay.diff(lastDay, ''month''); + xAxisLabelFormatterBound = xAxisLabelFormatter.bind({ + months, + days, + timeAxisFormatter: timeAxisFormatter.value, + timeCompare: completeDatas.value && timeCompare.value, + }) + } + if (completeDatas.value && totalTimes.value.length > 0) { + // 如果需要补全一个区间内的缺失数据 + // console.log(''serieData'', serieData); + if (timeCompare.value) { + const splitTimes = window.splitTimes(totalTimes.value, timeCompare.value); + const realIndexs = {}; // 正确数据索引 + const prevValues = splitTimes.prev.map((t, index) => { + let tVal = null; + if (timeCompare.value === ''day'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''HH:mm''); + } else if (timeCompare.value === ''month'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''DD''); + } else if (timeCompare.value === ''year'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''MM''); + } + if (!xAxisData.includes(tVal)) { + xAxisData.push(tVal); + realIndexs[index] = true; + const point = serieData.find(d => +d.ts === t); + return (point && point.val) || 0 + } + }) + const currValues = splitTimes.curr.map((t, index) => { + if (xAxisData.length === 0) { + let tVal = null; + if (timeCompare.value === ''day'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''HH:mm''); + } else if (timeCompare.value === ''month'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''DD''); + } else if (timeCompare.value === ''year'') { + tVal = dayjs(t).format(timeAxisFormatter.value || ''MM''); + } + if (!xAxisData.includes(tVal)) { + xAxisData.push(tVal); + const point = serieData.find(d => +d.ts === t); + return (point && point.val) || 0 + } + } else { + if (realIndexs[index]) { + const point = serieData.find(d => +d.ts === t); + return (point && point.val) || 0 + } + } + }) + let legendPrev = ''''; + let legendCurr = ''''; + if (keysLen > 1) { + legendPrev = `${legendKey}(${timeCompareMap[timeCompare.value].prev})`; + legendCurr = `${legendKey}(${timeCompareMap[timeCompare.value].curr})`; + } else if (keysLen === 1) { + legendPrev = `${timeCompareMap[timeCompare.value].prev}`; + legendCurr = `${timeCompareMap[timeCompare.value].curr}`; + } + legends.push(legendPrev); + legends.push(legendCurr); + series.push({ + name: legendPrev, + type: ''line'', + data: prevValues.filter(Boolean) + }) + series.push({ + name: legendCurr, + type: ''line'', + data: currValues.filter(Boolean) + }) + } else { + const serieValues = totalTimes.value.map(t => { + xAxisData.push(t); + const point = serieData.find(d => +d.ts === t); + return (point && point.val) || 0 + }) + series.push({ + name: legendKey, + type: ''line'', + data: serieValues + }) + } + } else { + const serieValues = serieData.map((point) => { + xAxisData.push(+point.ts); + return point.val; + }) + series.push({ + name: legendKey, + type: ''line'', + data: serieValues + }) + } + } + } + } else { + legends = [''测试图例''] + xAxisData = [1, 2, 3, 4, 5, 6, 7, 8] + series = [{ + type: ''line'', + name: ''测试图例'', + data: [], + }] + } + + // xAxisData 去重 + xAxisData = [...new Set(xAxisData)].sort(); + + const legendConfig = { + ...legend.value, + data: legends.filter(Boolean) + } + + const xAxisConfig = { + ...xAxis.value, + axisLabel: { + ...xAxis.value.axisLabel, + formatter: (completeDatas.value && timeCompare.value) ? null : xAxisLabelFormatterBound + }, + nameLocation: ''end'', + nameGap: 5, + nameTextStyle: { + color: xAxis.value.nameColor, + verticalAlign: ''top'', + lineHeight: 28 + }, + data: xAxisData + } + + // 指定图表的配置项和数据 + var option = { + grid: grid.value, + title: title.value, + tooltip: { + ...tooltip.value, + formatter: tooltipFormatterBound, + borderColor: tooltip.value.backgroundColor, + textStyle: { + ...tooltip.value.textStyle, + align: ''left'' + } + }, + legend: legendConfig, + xAxis: xAxisConfig, + yAxis: yAxis.value, + series: series, + }; + const func = new Function(''option'', ''datas'', ''instance'', codeConfig.value); + const opt = func(window._.cloneDeep(option), datas, myChart); + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(opt); + } + } + } + + watch(historyDatas, (val) => { + if (val) { + nextTick(() => { + initChart(val) + }) + } + }, { + immediate: true + }) + } +} + +class CustomLineChartNode extends HtmlResize.view { + chartRendered = false + historyDatas = [] + oldProperties = "{}" + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height, } = this.props.model; + const { nodeAlias, grid, title, legend, tooltip, xAxis, yAxis, codeConfig, dynamic, apiid, renderMode } = properties; + const { normalData } = dynamic || {}; + const { timeAxisFormatter, completeDatas, timeCompare, dataShowTypes, legendNameType } = normalData || {}; + + let totalTimes = []; + if (completeDatas) { + if (apiid) { + const param = window.totalApiParams[apiid]; + const info = totalDeviceInfos[apiid]; + totalTimes = window.completeTimesForChart(param, info, this.historyDatas, apiid); + } + } + + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(LineChart, { + name: nodeAlias, + lineId: `line-${properties.id}`, + historyDatas: this.historyDatas, + width, + height, + grid, title, legend, tooltip, xAxis, yAxis, + codeConfig, + timeAxisFormatter, completeDatas, + totalTimes, + timeCompare, + apiid, dataShowTypes, legendNameType, + renderMode + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + } + + sameProps(properties) { + const isSame = window._.isEqual(JSON.parse(this.oldProperties), properties); + if (isSame) return true; + this.oldProperties = JSON.stringify(properties); + return false + } + + // 过滤历史数据 + filterHistoryData(thingCodeArr, dataPointArr, apiid, renderIntervalEnabled) { + if (dataPointArr && dataPointArr.length > 0) { + let datas = [] + if (renderIntervalEnabled) { + datas = window.totalHistoryDatas[apiid]; + } else { + if (window.globalDashboardDatas[apiid]) { + datas = window.globalDashboardDatas[apiid].values; + } + } + if (datas && datas.length > 0) { + const gotValues = datas.filter((val) => thingCodeArr.includes(val.thingCode) && dataPointArr.includes(val.attrKey)) + this.historyDatas = gotValues + this.chartRendered = true; + } + } + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { apiid } = properties; + const { normalData } = properties.dynamic || {}; + const { dataPointArr, defaultValue, thingCodeArr, customApiDatas } = normalData || {} + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.historyDatas = defaultSocketValue; + return true + } else if (normalData && !normalData.dataPoint && normalData.defaultValue) { + this.historyDatas = JSON.parse(defaultValue); + return true + } + + // 如果采用来自自定义数据源的数据 + if (customApiDatas) { + this.historyDatas = customApiDatas; + return true + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + propertiesBack.dynamic.normalData.defaultValue = ''''; + if (this.sameProps(propertiesBack) && this.chartRendered) { + return false + } + + if (dataPointArr && apiid && !this.chartRendered) { + this.filterHistoryData(thingCodeArr, dataPointArr, apiid, normalData.renderIntervalEnabled); + return true; + } + } + return true; + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + const { renderInterval, dataPointArr, thingCodeArr } = normalData || {}; + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + const initRender = () => { + // 第一次历史数据返回可能比较慢,轮询判断 + let times = 0 + const inter = setInterval(() => { + if (window.totalHistoryDatas && window.totalHistoryDatas[properties.apiid]) { + this.filterHistoryData(thingCodeArr, dataPointArr, properties.apiid, normalData.renderIntervalEnabled); + this.setHtml(this.rootEl); + clearInterval(inter); + } + if (times > 20) { + clearInterval(inter) + } + times++; + }, 1000) + } + initRender(); + + let inters = parseInt(renderInterval || ''300000'') + if (normalData && !normalData.renderIntervalEnabled) { + inters = 1000 + } + setInterval(() => { + if (window.totalHistoryDatas[properties.apiid]) { + this.filterHistoryData(thingCodeArr, dataPointArr, properties.apiid, normalData.renderIntervalEnabled); + this.setHtml(this.rootEl); + } + }, inters) + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class CustomLineChartModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''custom-line-chart'', + view: CustomLineChartNode, + model: CustomLineChartModel, +})', '', 1001, NULL, 1699972072580583400, 1067246875800000001, 1703498148787, 1067246875800000001, 1721286640433, 't', '时序', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612826886146, 'custom-divide-node', '除号', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "dd1f5fd8-8433-4f3e-837e-266581e0d000", + "type": "custom-divide-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "dd1f5fd8-8433-4f3e-837e-266581e0d000", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "除号", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 除号 +class DivideModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class DivideView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y + 1 / 8 * height], + [x - 1 / 2 * width, y + 1 / 8 * height], + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + + const attrs = { + ...style, + x, + y, + width, + height, + } + + // 除号中间横线 + const lineAttrs = { + ...attrs, + points: points.join('' '') + } + + // 除号上圆点 + const upEllipseAttrs = { + ...attrs, + cy: y - 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + // 除号下圆点 + const downEllipseAttrs = { + ...attrs, + cy: y + 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + return h(''g'', {}, [ + h(''polygon'', { ...lineAttrs }), + h(''ellipse'', { ...upEllipseAttrs }), + h(''ellipse'', { ...downEllipseAttrs }) + ]) + } + +} + +lf.register({ + type: ''custom-divide-node'', + view: DivideView, + model: DivideModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148524, 1067246875800000001, 1721286640906, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102614164869121, 'custom-rightarrow-node', '右箭头', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设��","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"editorState":"default"},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","className":"mx-20 text-left","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "2bea1157-bcab-488f-8eb4-007d280f08cd", + "type": "custom-rightarrow-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "2bea1157-bcab-488f-8eb4-007d280f08cd", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "右箭头", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', 'class RightArrowModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class RightArrowView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height; + const leftX = x - 1 / 2 * width; + const rightX = x + 1 / 2 * width; + const rightX2 = x + 1 / 5 * width; + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [rightX2, y - 1 / 2 * ArrowHeight], + [rightX2, y - 1 / 2 * height], + [rightX, y], + [rightX2, y + 1 / 2 * height], + [rightX2, y + 1 / 2 * ArrowHeight], + [leftX, y + 1 / 2 * ArrowHeight], + [leftX, y - 1 / 2 * ArrowHeight], + ] + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ] + ); + } +} + +lf.register({ + type: ''custom-rightarrow-node'', + view: RightArrowView, + model: RightArrowModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148839, 1067246875800000001, 1721286641058, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102614928232450, 'custom-button-node', '按钮', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"input-number","label":"边框圆角","name":"borderRadius","keyboard":true,"id":"u:eaf3965368f9","step":1,"mode":"horizontal","inputClassName":"w-full","suffix":"px"},{"type":"input-text","label":"背景","name":"background","id":"u:b1bba6906785","editorState":"default","mode":"horizontal"},{"type":"select","label":"背景尺寸","name":"backgroundSize","options":[{"label":"覆盖","value":"cover"},{"label":"包含","value":"contain"},{"label":"宽高撑满","value":"100% 100%"}],"id":"u:29aebfca7bf3","multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"按钮阴影","name":"boxShadow","id":"u:3f5b1a8f5cc4","editorState":"default","mode":"horizontal"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"2","header":"数据/外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"editorState":"default"},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景色","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景图片","name":"background","type":"input-text","placeholder":"输入背景链接","id":"u:f5d9ca3df814"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景色","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景图片","name":"background","type":"input-text","placeholder":"输入背景链接","id":"u:f5d9ca3df814"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景色","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景图片","name":"background","type":"input-text","placeholder":"输入背景链接","id":"u:f5d9ca3df814"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}}},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}}},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"},{"type":"select","label":"用户","name":"users","id":"u:18f4db277518","multiple":true,"source":{"url":"/thing/sys/tenant/user","method":"get","headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"realName","valueField":"id","checkAll":false,"clearable":true}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "294b013f-14d3-429e-a078-048da5f0261e", + "type": "custom-button-node", + "x": 200, + "y": 200, + "text": { + "value": "测试按钮", + "x": 200, + "y": 200 + }, + "properties": { + "id": "294b013f-14d3-429e-a078-048da5f0261e", + "width": 80, + "height": 35, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "fontSize": 14, + "boxShadow": "0 2px 0 rgba(0, 0, 0, 0.45)", + "nodeAlias": "按钮", + "fontColor": "#ffffff", + "strokeColor": "", + "content": "测试按钮", + "lineHeight": 35, + "fontStyle": "", + "fill": "rgb(24, 144, 255)", + "background": "", + "borderRadius": 6, + "backgroundSize": "100% 100%", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "config": "{\"globalInputParamsCalculated\":[],\"eventAction\":\"sendCommand\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}", + "users": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "equal", + "label": "相等", + "name": "" + } + ] + }, + "animationData": { + "animationCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', ' + +const { createApp, createVNode, render } = Vue; +const app = createApp({}) +const Button = { + template: ''
{{name}}
'', + props: { + name: { + type: String, + default: ''按钮11'' + }, + fontColor: { + type: String, + default: ''#ffffff'' + }, + fontSize: { + type: Number, + default: 14 + }, + fontFamily: { + type: String, + default: ''宋体'' + }, + fontStyle: { + type: String, + default: ''normal'' + }, + width: { + type: Number, + default: 80 + }, + height: { + type: Number, + default: 35 + }, + lineHeight: { + type: Number, + default: 35, + }, + backgroundColor: { + type: String, + default: ''#1890ff'', + }, + strokeColor: { + type: String, + default: ''#1890ff'', + }, + strokeWidth: { + type: Number, + default: 1, + }, + opacity: { + type: Number, + default: 1, + }, + background: { + type: String, + default: '''', + }, + backgroundSize: { + type: String, + default: ''100% 100%'', + }, + boxShadow: { + type: String, + default: '''', + }, + borderRadius: { + type: Number, + default: 6, + }, + realValue: { + type: [String, Number], + default: '''' + } + }, + computed: { + getStyle () { + const { fontColor, fontSize, fontFamily, fontStyle, width, height, lineHeight, backgroundColor,strokeColor,strokeWidth, opacity, background, backgroundSize, boxShadow, borderRadius } = this + const style = {} + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + let back = background; + if (back && !back.includes(''url'')) { + back = `url(${back})` + } + return { + color: fontColor, + "font-size": parseInt(fontSize) + ''px'', + "font-family": fontFamily, + "font-style": style.fontStyle, + "font-weight": style.fontWeight, + "text-decoration": style.textDecoration, + width: parseInt(width) - parseInt(strokeWidth) * 2 + ''px'', + height: parseInt(height) - parseInt(strokeWidth) * 2 + ''px'', + lineHeight: parseInt(lineHeight) - parseInt(strokeWidth) * 2 + ''px'', + "text-align": ''center'', + ''background'': backgroundColor || back, + ''background-size'': backgroundSize, + "border-radius": borderRadius + ''px'', + "box-shadow": boxShadow, + "border-color": strokeColor, + "border-style": "solid", + "border-width": parseInt(strokeWidth) + ''px'', + "opacity": opacity, + cursor: ''pointer'' + } + } + }, + emits: [''click'', ''dblClick''], + setup(props, { emit } ) { + const {ref, toRefs, computed, watch} = Vue + const { realValue } = toRefs(props); + const clickHandler = () => { + emit(''click'', realValue.value) + } + const dblClickHandler = () => { + emit(''dblClick'', realValue.value) + } + return { + clickHandler, + dblClickHandler, + } + } +} + +class CustomButtonNode extends HtmlResize.view { + clickTime = '''' + + setHtml(rootEl) { + const { graphModel } = this.props; + const { properties, width, height, } = this.props.model; + const { content, fontColor, fontSize, fontFamily, fontStyle, lineHeight, fill, strokeColor,strokeWidth, opacity, background, boxShadow, borderRadius } = properties; + const { model } = this.props; + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + + const { uiData, eventsData } = properties.dynamic || {}; + + const findClick = eventsData?.eventCombo.find( i => i.eventType === ''click''); + + const clickHandler = (e) => { + if(uiData.dataPoint && findClick && findClick.enable) { + const now = new Date().getTime(); + if (this.clickTime) { + if (now - this.clickTime <= 10000) { + messageFn(''10秒之内不能重复触发'') + return; + } + } + this.clickTime = now; + } + const cacheToken = sessionStorage.getItem(''v1@CacheToken''); + if(!cacheToken) { + return window.createLoginDialog(); + } + const tokenParsed = JSON.parse(cacheToken || ''{}''); + if (findClick.users && !findClick.users.includes(tokenParsed.userid)) { + return messageFn(''无用户权限'') + } + graphModel.eventCenter.emit("myNode:click", { + data: this.props.model, + e, + }); + } + + const dblClickHandler = (e) => { + graphModel.eventCenter.emit("myNode:dbclick", { + data: this.props.model, + e, + }); + } + + let dynamicBack = background; + let dynamicName = content + let fillColor = fill + let fontC = fontColor + let realValue = '''' + if (uiData) { + realValue = window.resolveScadaNewValue(uiData.defaultValue) + if (realValue !== '''') { + uiData.conditionVariables.forEach((item) => { + if (item.type === ''rangeColor'') { + let from = item.from; + let to = item.to; + if (item.from >= item.to) { + from = item.to; + to = item.from; + } + if (item.backColor && Number(realValue) >= from && Number(realValue) <= to) { + fillColor = item.backColor + } + if (item.fontColor && Number(realValue) >= from && Number(realValue) <= to) { + fontC = item.fontColor + } + if (item.background && Number(realValue) >= from && Number(realValue) <= to) { + dynamicBack = item.background + } + } else if (item.type === ''equal'') { + if(Number(realValue) === Number(item.value)) { + item.backColor && (fillColor = item.backColor); + item.fontColor && (fontC = item.fontColor); + dynamicName = item.valueLabel; + item.background && (dynamicBack = item.background); + } + } else if (item.type === ''boolean'') { + const trueFlags = [''true'', true] + const falseFlags = [''false'', false] + const truetrue = trueFlags.includes(item.value) && trueFlags.includes(realValue) + const falsefalse = falseFlags.includes(item.value) && falseFlags.includes(realValue) + if (truetrue || falsefalse) { + item.backColor && (fillColor = item.backColor); + item.fontColor && (fontC = item.fontColor); + dynamicName = item.valueLabel; + item.background && (dynamicBack = item.background); + } + } + }) + } + } + + const instance = createVNode(Button, { + name: dynamicName, + fontColor: fontC, + fontSize, fontFamily, fontStyle,width, height, lineHeight, + backgroundColor: fillColor, + strokeColor,strokeWidth, + opacity, + background: dynamicBack, + boxShadow, + borderRadius, + realValue, + onClick: clickHandler, + onDblClick: dblClickHandler, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + } +} + +class CustomButtonModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''custom-button-node'', + view: CustomButtonNode, + model: CustomButtonModel, +}) + +', '', 1001, NULL, 1001, 1067246875800000001, 1703498149021, 1067246875800000001, 1721286641321, 't', '控制', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (109414855116681216, 'horizontal-capsule-tank', '水平胶囊水箱', 1655394372066877442, ' + + + + + + + + + + + + + + + + + + + +', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","mode":"horizontal","format":"rgba","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}]},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "ef5c97a6-83e8-42df-b149-43597512b798", + "type": "horizontal-capsule-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "ef5c97a6-83e8-42df-b149-43597512b798", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": true, + "unitColor": "rgba(74, 144, 226, 1)", + "nodeAlias": "水平胶囊水箱", + "showDefaultValue": false, + "fontSize": 12, + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const VerticalCapsuleTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(26 - (realValue / maxValue * 60)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class VerticalCapsuleTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(VerticalCapsuleTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class VerticalCapsuleTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''horizontal-capsule-tank'', + view: VerticalCapsuleTankNode, + model: VerticalCapsuleTankModel, +}) + +', '', 1001, 1001, 1001, 1067246875800000001, 1706498194289, 1067246875800000001, 1721804073992, 't', '时间', 'f', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612323569665, 'custom-minus-node', '减号', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公���","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "9998a541-50fb-42c2-af33-6cca79e21c7d", + "type": "custom-minus-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "9998a541-50fb-42c2-af33-6cca79e21c7d", + "width": 100, + "height": 20, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "减号", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 减号 +class MinusModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 20; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + }; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class MinusView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 2 * height], + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} + +lf.register({ + type: ''custom-minus-node'', + view: MinusView, + model: MinusModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148401, 1067246875800000001, 1721286640917, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612130631681, 'custom-rect-node', '方形矩形', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "1", + "type": "custom-rect-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "1", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "borderDirection": "border", + "nodeAlias": "方形矩形", + "borderWidth": 1, + "borderTopLeftRadius": 1, + "borderStyle": "solid", + "backgroundColor": "", + "backgroundRepeat": "repeat-x", + "content": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "rangeImage", + "label": "范围/图片", + "name": "", + "imageUrl": "" + } + ], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', ' +class CustomRectNodeView extends RectResize.view { } +class CustomRectNodeModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 150; + this.height = properties.height || 80; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if (showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + }; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + style.fill = properties.fill || style.fill; + + const { uiData } = properties.dynamic; + if (uiData) { + const realValue = window.resolveScadaNewValue(uiData.defaultValue) + uiData.conditionVariables.forEach((item) => { + if (item.type === ''rangeColor'') { + let from = item.from; + let to = item.to; + if (item.from >= item.to) { + from = item.to; + to = item.from; + } + if (item.color && Number(realValue) >= from && Number(realValue) <= to) { + style.fill = item.color + } + } + + if (item.type === ''rangeImage'') { + let from = item.from; + let to = item.to; + if (item.from >= item.to) { + from = item.to; + to = item.from; + } + if (item.imageUrl && Number(realValue) >= from && Number(realValue) <= to) { + const href = item.imageUrl; + const id = properties.id; + window.createSvgPattern(id, href, properties.width, properties.height); + setTimeout(() => { + style.fill = `url(#{id})`; + }, 1000) + } + } + }) + } + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if (fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if (fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + + +lf.register({ + type: ''custom-rect-node'', + view: CustomRectNodeView, + model: CustomRectNodeModel, +}) + +', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148354, 1067246875800000001, 1721286640987, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102614366195714, 'custom-star-node', '五角星', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "60015f23-73ec-4430-84cb-2fd03f9bc8d9", + "type": "custom-star-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "60015f23-73ec-4430-84cb-2fd03f9bc8d9", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "五角星", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 五角星 +class StarModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class StarView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const svgAttr = { + x: x - 1 / 2 * width, + y: y - 1 / 2 * height, + width, + height, + } + const pathAAttrs = { + ...style, + d: ''m0.36922,13.46587l12.98695,0l4.01307,-13.36885l4.01307,13.36885l12.98694,0l-10.50664,8.26231l4.01327,13.36885l-10.50665,-8.26253l-10.50664,8.26253l4.01327,-13.36885l-10.50665,-8.26231l0,0z'' + } + + return h(''svg'', { ...svgAttr, viewBox: ''0 0 37 37'' }, [ + h(''path'', { + ...pathAAttrs, + }) + ]) + } +} + +lf.register({ + type: ''custom-star-node'', + view: StarView, + model: StarModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148887, 1067246875800000001, 1721286641159, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102617042161666, 'custom-checkbox-node', '复选框', NULL, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边框圆角","name":"borderRadius","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f","keyboard":true,"step":1,"value":2,"suffix":"px","inputClassName":"w-full"}],"id":"u:afc37bde0156","md":12}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"fieldset","id":"u:4056d2352abb","title":"未选中复选框","collapsable":true,"body":[{"type":"input-color","label":"字色","name":"unselectedFontColor","id":"u:ce00647921e1","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(255, 255, 255, 1)"},{"type":"input-color","label":"边框颜色","name":"unselectedBorderColor","id":"u:58f86c683840","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(176, 174, 174, 1)"},{"type":"input-color","label":"背景色","name":"unselectedBack","id":"u:38546f1849f9","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(176, 174, 174, 1)"},{"type":"input-text","label":"背景图片","name":"unselectedBackImg","id":"u:b0fb37960b6b","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":""},{"type":"input-number","label":"字大小","name":"unselectedFontSize","keyboard":true,"id":"u:c39c16dc2c6d","step":1,"mode":"horizontal","inputClassName":"w-full","value":12,"suffix":"px"},{"type":"input-number","label":"边框宽度","name":"unselectedBorderWidth","keyboard":true,"id":"u:80420a8ac87c","step":1,"mode":"horizontal","inputClassName":"w-full","value":1,"suffix":"px"}],"bodyClassName":"m-b"},{"type":"fieldset","id":"u:7368b54ebde4","title":"已选中复选框","collapsable":true,"body":[{"type":"input-color","label":"字色","name":"selectedFontColor","id":"u:480f2b672673","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(255, 255, 255, 1)"},{"type":"input-color","label":"边框颜色","name":"selectedBorderColor","id":"u:0381bb57b562","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(74, 144, 226, 1)"},{"type":"input-color","label":"背景色","name":"selectedBack","id":"u:352a3918c01d","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":"rgba(74, 144, 226, 1)"},{"type":"input-text","label":"背景图片","name":"selectedBackImg","id":"u:41be0b92adbf","format":"rgba","mode":"horizontal","inputClassName":"w-full","className":"m-b","value":""},{"type":"input-number","label":"字大小","name":"selectedFontSize","keyboard":true,"id":"u:f9a61558bc7e","step":1,"mode":"horizontal","inputClassName":"w-full","value":12,"suffix":"px"},{"type":"input-number","label":"边框宽度","name":"selectedBorderWidth","keyboard":true,"id":"u:273c2a7eb623","step":1,"mode":"horizontal","inputClassName":"w-full","value":1,"suffix":"px"}],"bodyClassName":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"input-number","label":"字符间距","name":"fontSpace","keyboard":true,"id":"u:d05b551cf67c","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":0,"max":50},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"},{"type":"combo","label":"默认选项","name":"defaultOptions","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:08d88a5e111c"},"items":[{"type":"input-text","name":"label","placeholder":"标签","id":"u:b5c4bc1855e7"},{"type":"input-text","name":"value","placeholder":"值","id":"u:ec8ee3ef943e"}],"id":"u:ac8d96e032b9","strictMode":true,"syncFields":[],"tabsMode":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"数据源api","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"editor","label":"数据过滤","name":"dataFilterFn","id":"u:f9ef754971e0","language":"javascript","value":"return datas","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"入参为下拉框返回数据: datas"},"labelClassName":"text-left","inputClassName":"text-left","options":{"lineNumbers":"off"}}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":false,"addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"改变","value":"change"}],"id":"u:a7b44847011a","label":"名称"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"},{"type":"fieldset","id":"u:fbccd2ccc8a3","title":"目标节点发起请求","collapsable":true,"body":[{"type":"input-text","label":"目标节点","name":"targetNode","id":"u:6efb6f120e47","multiple":false,"mode":"horizontal","inputClassName":"w-full","visibleOn":"this.eventType === ''change''","removable":"true","placeholder":"目标节点id"},{"type":"select","label":"入参类型","name":"targetParamsType","options":[{"label":"物实体","value":"entitys"},{"label":"物属性","value":"attrs"},{"label":"时间","value":"times"}],"id":"u:d10a57a9b966","multiple":false,"mode":"horizontal","inputClassName":"w-full","removable":true},{"type":"radios","label":"入参实体","name":"targetParamsEntitys","options":[{"label":"物组","value":"group"},{"label":"列表","value":"list"},{"label":"关系","value":"relation"},{"label":"搜索","value":"search"},{"label":"标签","value":"tag"},{"label":"类型","value":"type"}],"id":"u:26df91ece010","onEvent":{"change":{"actions":[{"actionType":"custom","script":"console.log(''event'', event);"}]}},"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''entitys''"},{"type":"radios","label":"属性类型","name":"targetParamsAttrsType","options":[{"label":"分属性","value":"split"},{"label":"全部","value":"all"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参属性","name":"targetParamsAttrsKeysEntitys","options":[{"label":"物","value":"entitys"},{"label":"属性","value":"keys"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参时间","name":"targetParamsTimesType","options":[{"label":"最近","value":"nearest"},{"label":"时间段","value":"range"},{"label":"区间","value":"interval"}],"id":"u:26df91ece010","multiple":false,"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''times''"},{"type":"input-text","label":"超级api","name":"apiId","id":"u:912394455375","placeholder":"超级apiId"}]},{"type":"fieldset","id":"u:51249df94c65","title":"更多操作","collapsable":true,"body":[{"type":"tpl","tpl":"function (context, service, nodeId, event) {","inline":true,"wrapperComponent":"","id":"u:799cd3277731"},{"type":"editor","id":"u:77aca39f5961","label":"","name":"moreOperation","language":"javascript","className":"my-0"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:cd392cfb6ffb"}],"bodyClassName":"text-left"}],"id":"u:364496dd313b","removable":false,"removableMode":"icon","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"},"strictMode":true,"syncFields":[],"labelClassName":""}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "e56e2ab8-9ca9-4458-81fd-7c308954882b", + "type": "custom-checkbox-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "e56e2ab8-9ca9-4458-81fd-7c308954882b", + "width": 100, + "height": 18, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "borderRadius": 6, + "unselectedFontColor": "rgba(255, 255, 255, 1)", + "unselectedBorderColor": "rgba(176, 174, 174, 1)", + "unselectedBack": "rgba(176, 174, 174, 1)", + "unselectedBackImg": "", + "unselectedFontSize": 12, + "unselectedBorderWidth": 1, + "selectedFontColor": "rgba(255, 255, 255, 1)", + "selectedBorderColor": "rgba(74, 144, 226, 1)", + "selectedBack": "rgba(74, 144, 226, 1)", + "selectedBackImg": "", + "selectedFontSize": 12, + "selectedBorderWidth": 1, + "fontSize": 12, + "nodeAlias": "复选框", + "showDefaultValue": false, + "showUnit": false, + "valueColor": "rgba(245, 166, 35, 1)", + "fontColor": "rgba(74, 74, 74, 1)", + "fontFamily": "Microsoft Yahei", + "fontStyle": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "", + "dataFilterFn": "return datas", + "defaultOptions": [ + { + "label": "电", + "value": "A29" + }, + { + "label": "水", + "value": "B2" + } + ] + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "change", + "enable": false, + "config": "", + "customEventHandler": false, + "targetParamsType": "entitys", + "targetParamsEntitys": "list" + } + ] + } + } + } + } + ] +}', '', ' + + + +const { createApp, createVNode, render } = Vue; +const app = createApp({}) +const CheckBox = { + template: `
+
+
+ + + + +
+ {{item.label}} +
+
`, + props: { + realValue: { + type: String, + default: '''' + }, + radioList: { + type: Array, + default: () => [] + }, + fontColor: { + type: String, + default: ''#ffffff'' + }, + fontSize: { + type: Number, + default: 14 + }, + fontFamily: { + type: String, + default: ''宋体'' + }, + fontStyle: { + type: String, + default: ''normal'' + }, + width: { + type: Number, + default: 80 + }, + height: { + type: Number, + default: 35 + }, + unselectedFontColor: { + type: String, + default: ''rgba(255, 255, 255, 1)'' + }, + borderRadius: { + type: Number, + default: 2 + }, + unselectedBorderColor: { + type: String, + default: ''rgba(176, 174, 174, 1)'' + }, + unselectedBack: { + type: String, + default: ''rgba(176, 174, 174, 1)'' + }, + unselectedBackImg: { + type: String, + default: '''' + }, + unselectedFontSize: { + type: Number, + default: 12 + }, + unselectedBorderWidth: { + type: Number, + default: 1 + }, + selectedFontColor: { + type: String, + default: ''rgba(255, 255, 255, 1)'' + }, + selectedBorderColor: { + type: String, + default: ''rgba(74, 144, 226, 1)'' + }, + selectedBack: { + type: String, + default: ''rgba(74, 144, 226, 1)'' + }, + selectedBackImg: { + type: String, + default: '''' + }, + selectedFontSize: { + type: Number, + default: 12 + }, + selectedBorderWidth: { + type: Number, + default: 1 + } + }, + emits: ["change"], + computed: { + getStyle() { + const { width, height, borderRadius } = this; + return { + width: width + ''px'', + height: height + ''px'', + display: ''flex'', + "flex-direction": width > height ? "row" : "column", + "justify-content": "flex-start", + "align-items": "center", + ''border-radius'': borderRadius + ''px'', + ''overflow'': ''hidden'' + } + }, + getTabStyle: () => (item, unselectedFontColor, unselectedBorderColor, unselectedBack, unselectedBackImg, unselectedFontSize, + unselectedBorderWidth, selectedFontColor, selectedBorderColor, selectedBack, selectedBackImg, selectedFontSize, + selectedBorderWidth, borderRadius) => { + if (!item.checked) { + return { + color: unselectedFontColor, + ''font-size'': unselectedFontSize + ''px'', + ''border-style'': "solid", + ''border-width'': unselectedBorderWidth + ''px'', + ''border-color'': unselectedBorderColor, + ''border-radius'': borderRadius + ''px'', + ''background-color'': unselectedBack, + ''background-image'': unselectedBackImg ? "url(" + unselectedBackImg + ")" : ''none'', + ''display'': ''flex'', + ''justify-content'': ''center'', + ''align-items'': ''center'', + ''flex'': ''1'', + ''height'': ''100%'', + ''width'': ''100%'', + ''cursor'': ''pointer'' + } + } else { + return { + color: selectedFontColor, + ''font-size'': selectedFontSize + ''px'', + ''border-style'': "solid", + ''border-width'': selectedBorderWidth + ''px'', + ''border-color'': selectedBorderColor, + ''border-radius'': borderRadius + ''px'', + ''background-color'': selectedBack, + ''background-image'': selectedBackImg ? "url(" + selectedBackImg + ")" : ''none'', + ''display'': ''flex'', + ''justify-content'': ''center'', + ''align-items'': ''center'', + ''flex'': ''1'', + ''height'': ''100%'', + ''width'': ''100%'', + ''cursor'': ''pointer'' + } + } + }, + getLabelStyle() { + const { fontStyle } = this; + const style = {}; + if (fontStyle) { + if (fontStyle.includes(''bold'')) { + style["font-weight"] = ''bolder''; + } + if (fontStyle.includes(''italic'')) { + style["font-style"] = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style["text-decoration"] = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style["text-decoration"] = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style["text-decoration"] = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style["text-decoration"] = ''line-through'' + } + } + return { + flex: ''auto'', + ''margin-left'': ''5px'', + color: this.fontColor, + ''font-size'': this.fontSize + ''px'', + ''font-family'': this.fontFamily, + ...style, + } + } + }, + setup(props, { emit }) { + const { ref, watch } = Vue + const myRadioList = ref([]) + const clickHandler = (item) => { + myRadioList.value.forEach((el) => { + if (el.value === item.value) { + el.checked = !el.checked; + } + }) + const selects = myRadioList.value.map(i => i.value); + emit("change", selects); + } + + watch(() => props.radioList, (val) => { + myRadioList.value = val + }, { + immediate: true, + }) + + watch(() => props.realValue, (val) => { + if (val) { + myRadioList.value.forEach((el) => { + const valArr = String(val).split(",") + if (valArr.includes(el.value)) { + el.checked = true; + } else { + el.checked = false + } + }) + } + }, { + immediate: true, + }) + + return { + clickHandler, + myRadioList + } + } + +} + +class CustomCheckBoxNode extends HtmlResize.view { + oldProperties = {} + + setHtml(rootEl) { + const { properties, width, height, } = this.props.model; + const { fontColor, fontSize, fontFamily, fontStyle, + unselectedFontColor, unselectedBorderColor, unselectedBack, unselectedBackImg, unselectedFontSize, + unselectedBorderWidth, selectedFontColor, selectedBorderColor, selectedBack, selectedBackImg, selectedFontSize, + selectedBorderWidth, borderRadius + } = properties; + const { model, graphModel } = this.props; + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + + const { normalData } = properties.dynamic || {}; + const { defaultOptions } = normalData || {}; + let list = []; + if (defaultOptions) { + let opts = [] + if (typeof defaultOptions !== ''string'') { + opts = defaultOptions + } else { + opts = JSON.parse(defaultOptions); + } + list = window._.cloneDeep(opts).map((el, index) => { + if (index === 0) { + el.checked = true + } else { + el.checked = false + } + return el; + }) + } + + let realValue = ""; + if (normalData) { + realValue = window.resolveScadaNewValue(normalData.defaultValue); + } + + const changeHandler = (e) => { + graphModel.eventCenter.emit("node:change", { + data: this.props.model, + e, + }); + } + + const instance = createVNode(CheckBox, { + realValue, + radioList: list, + fontColor, + fontSize, fontFamily, fontStyle, width, height, + unselectedFontColor, unselectedBorderColor, unselectedBack, unselectedBackImg, unselectedFontSize, + unselectedBorderWidth, selectedFontColor, selectedBorderColor, selectedBack, selectedBackImg, selectedFontSize, + selectedBorderWidth, borderRadius, + onChange: changeHandler + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const propertiesBack = window._.cloneDeep(properties); + // 由于事件change 会给properties 增加一个 event 属性(见目录scadaDashboard/Diagram/useDynamicEventsHandler),会引发属性的改变,导致组件重渲染。 + delete propertiesBack.event; + if (this.sameProps(propertiesBack)) { + return false + } + return true; + } +} + +class CustomCheckBoxModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''custom-checkbox-node'', + view: CustomCheckBoxNode, + model: CustomCheckBoxModel, +}) + +', NULL, 1001, NULL, 1699972072580583400, 1067246875800000001, 1703498149525, 1067246875800000001, 1721286641381, 't', '文字', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102613414088706, 'custom-cross-node', '加号', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "0db47794-ee89-44b6-b50e-6fcc85089fd9", + "type": "custom-cross-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "0db47794-ee89-44b6-b50e-6fcc85089fd9", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": "", + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "加号", + "fill": "", + "fontStyle": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "equal", + "label": "相等", + "name": "" + } + ] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 加号 +class CrossModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class CrossView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1/2 * width, y - 1/6 * height], + [x - 1/6 * width, y - 1/6 * height], + [x - 1/6 * width, y - 1/2 * height], + [x + 1/6 * width, y - 1/2 * height], + [x + 1/6 * width, y - 1/6 * height], + [x + 1/2 * width, y - 1/6 * height], + [x + 1/2 * width, y + 1/6 * height], + [x + 1/6 * width, y + 1/6 * height], + [x + 1/6 * width, y + 1/2 * height], + [x - 1/6 * width, y + 1/2 * height], + [x - 1/6 * width, y + 1/6 * height], + [x - 1/2 * width, y + 1/6 * height], + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} + +lf.register({ + type: ''custom-cross-node'', + view: CrossView, + model: CrossModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148660, 1067246875800000001, 1721286640631, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102611803475969, 'custom-heptagon-node', '八边形', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "d1f70cfd-ec5d-4f89-8c87-5e976d757190", + "type": "custom-heptagon-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "d1f70cfd-ec5d-4f89-8c87-5e976d757190", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "八边形", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "equal", + "label": "相等", + "name": "" + } + ] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 八边形 +class HeptagonModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class HeptagonView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.205 * width, y - 0.5 * height], + [x + 0.205 * width, y - 0.5 * height], + [x + 0.5 * width, y - 0.205 * height], + [x + 0.5 * width, y + 0.205 * height], + [x + 0.205 * width, y + 0.5 * height], + [x - 0.205 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.205 * height], + [x - 0.5 * width, y - 0.205 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join('' '') + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ]) + } + +} + +lf.register({ + type: ''custom-heptagon-node'', + view: HeptagonView, + model: HeptagonModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148279, 1067246875800000001, 1721286640792, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (109420676273762304, 'horizontal-dishends-tank', '水平碟状边缘水箱', NULL, ' + + + + + + + + + + + + + + + + + + + + +', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","mode":"horizontal","format":"rgba","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}]},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "5e019bc7-8031-4273-af34-6b10920e09c6", + "type": "horizontal-dishends-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "5e019bc7-8031-4273-af34-6b10920e09c6", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": true, + "unitColor": "rgba(74, 144, 226, 1)", + "nodeAlias": "水平碟状边缘水箱", + "showDefaultValue": false, + "fontSize": 12, + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const HorizontalDishendsTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(27 - (realValue / maxValue * 60)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class HorizontalDishendsTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(HorizontalDishendsTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class HorizontalDishendsTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''horizontal-dishends-tank'', + view: HorizontalDishendsTankNode, + model: HorizontalDishendsTankModel, +}) + +', NULL, 1001, 1001, 1001, 1067246875800000001, 1706499582161, 1067246875800000001, 1721286641804, 't', '时间', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102615947448322, 'custom-radios-node', '单选按钮', NULL, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":16,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":16,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"fieldset","title":"未选中外框","collapsable":true,"body":[{"type":"input-color","label":"边框颜色","name":"unselectedBorderColor","id":"u:1e65f3019268","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"外框背景","name":"unselectedBackColor","id":"u:5ec595ff09fa","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"边框宽度","name":"unselectedBorderWidth","keyboard":true,"id":"u:f4ddfdfcd992","step":1,"value":1,"mode":"horizontal","inputClassName":"w-full","className":"m-b"},{"type":"input-number","label":"外框直径","name":"unselectedDiameter","keyboard":true,"id":"u:88b2fa1cd79c","step":1,"value":16,"mode":"horizontal","inputClassName":"w-full","className":"m-b"}],"id":"u:6074abb701a2","bodyClassName":"m-b"},{"type":"fieldset","title":"已选中外框","collapsable":true,"body":[{"type":"input-color","label":"边框颜色","name":"selectedBorderColor","id":"u:f5d425de2baa","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"外框背景","name":"selectedBackColor","id":"u:c8b1d7ecdc6f","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"边框宽度","name":"selectedBorderWidth","keyboard":true,"id":"u:8d4d2889feec","step":1,"value":1,"mode":"horizontal","inputClassName":"w-full","className":"m-b"},{"type":"input-number","label":"边框直径","name":"selectedDiameter","keyboard":true,"id":"u:64f6d1af395f","step":1,"value":16,"mode":"horizontal","inputClassName":"w-full","className":"m-b"}],"id":"u:abbd40293dc1","bodyClassName":"m-b"},{"type":"fieldset","title":"已选中内框","collapsable":true,"body":[{"type":"input-color","label":"边框颜色","name":"selectedInnerBorderColor","id":"u:48d3c1bd1bf6","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"内框背景","name":"selectedInnerBackColor","id":"u:fa877bb5271c","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"边框宽度","name":"selectedInnerBorderWidth","keyboard":true,"id":"u:555d4566b41d","step":1,"value":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"边框直径","name":"selectedInnerDiameter","keyboard":true,"id":"u:eaa412061a52","step":1,"value":10,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:925e078bc179"},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"input-number","label":"字符间距","name":"fontSpace","keyboard":true,"id":"u:d05b551cf67c","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":0,"max":50},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"},{"type":"combo","label":"默认选项","name":"defaultOptions","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:08d88a5e111c"},"items":[{"type":"input-text","name":"label","placeholder":"标签","id":"u:b5c4bc1855e7"},{"type":"input-text","name":"value","placeholder":"值","id":"u:ec8ee3ef943e"}],"id":"u:ac8d96e032b9","strictMode":true,"syncFields":[],"tabsMode":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-text","label":"数据源api","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"editor","label":"数据过滤","name":"dataFilterFn","id":"u:f9ef754971e0","language":"javascript","value":"return datas","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","content":"入参为下拉框返回数据: datas"},"labelClassName":"text-left","inputClassName":"text-left","options":{"lineNumbers":"off"}}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":false,"removable":false,"addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"改变","value":"change"}],"id":"u:a7b44847011a","label":"名称"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"},{"type":"fieldset","id":"u:fbccd2ccc8a3","title":"目标节点发起请求","collapsable":true,"body":[{"type":"input-text","label":"目标节点","name":"targetNode","id":"u:6efb6f120e47","multiple":false,"mode":"horizontal","inputClassName":"w-full","visibleOn":"this.eventType === ''change''","removable":"true","placeholder":"目标节点id"},{"type":"select","label":"入参类型","name":"targetParamsType","options":[{"label":"物实体","value":"entitys"},{"label":"物属性","value":"attrs"},{"label":"时间","value":"times"}],"id":"u:d10a57a9b966","multiple":false,"mode":"horizontal","inputClassName":"w-full","removable":true},{"type":"radios","label":"入参实体","name":"targetParamsEntitys","options":[{"label":"物组","value":"group"},{"label":"列表","value":"list"},{"label":"关系","value":"relation"},{"label":"搜索","value":"search"},{"label":"标签","value":"tag"},{"label":"类型","value":"type"}],"id":"u:26df91ece010","onEvent":{"change":{"actions":[{"actionType":"custom","script":"console.log(''event'', event);"}]}},"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''entitys''"},{"type":"radios","label":"属性类型","name":"targetParamsAttrsType","options":[{"label":"分属性","value":"split"},{"label":"全部","value":"all"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参属性","name":"targetParamsAttrsKeysEntitys","options":[{"label":"物","value":"entitys"},{"label":"属性","value":"keys"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参时间","name":"targetParamsTimesType","options":[{"label":"最近","value":"nearest"},{"label":"时间段","value":"range"},{"label":"区间","value":"interval"}],"id":"u:26df91ece010","multiple":false,"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''times''"},{"type":"input-text","label":"超级api","name":"apiId","id":"u:912394455375","placeholder":"超级apiId"}]},{"type":"fieldset","id":"u:51249df94c65","title":"更多操作","collapsable":true,"body":[{"type":"tpl","tpl":"function (context, service, nodeId, event) {","inline":true,"wrapperComponent":"","id":"u:799cd3277731"},{"type":"editor","id":"u:77aca39f5961","label":"","name":"moreOperation","language":"javascript","className":"my-0"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:cd392cfb6ffb"}],"bodyClassName":"text-left"}],"id":"u:364496dd313b","removableMode":"icon","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"},"strictMode":true,"syncFields":[],"labelClassName":""}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "88cbfa0c-7a9e-4da3-b727-a11eda60a3f0", + "type": "custom-radios-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "88cbfa0c-7a9e-4da3-b727-a11eda60a3f0", + "width": 150, + "height": 30, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "unselectedBorderWidth": 1, + "unselectedDiameter": 16, + "selectedBorderWidth": 1, + "selectedDiameter": 16, + "selectedInnerBorderWidth": 0, + "selectedInnerDiameter": 10, + "fontSize": 12, + "nodeAlias": "单选按钮", + "showDefaultValue": false, + "showUnit": false, + "valueColor": "rgba(245, 166, 35, 1)", + "unselectedBorderColor": "rgba(155, 155, 155, 1)", + "unselectedBackColor": "rgba(255, 255, 255, 0)", + "selectedBorderColor": "rgba(74, 144, 226, 1)", + "selectedBackColor": "rgba(255, 255, 255, 0)", + "selectedInnerBorderColor": "rgba(74, 144, 226, 1)", + "selectedInnerBackColor": "rgba(74, 144, 226, 1)", + "fontColor": "rgba(74, 74, 74, 1)", + "fontFamily": "Microsoft Yahei", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "", + "dataFilterFn": "return datas", + "defaultOptions": [ + { + "label": "电", + "value": "A29" + }, + { + "label": "水", + "value": "B2" + } + ] + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "change", + "enable": false, + "config": "", + "customEventHandler": false, + "targetParamsType": "entitys", + "targetParamsEntitys": "list" + } + ] + } + } + } + } + ] +}', '.scada-radio { + position: relative; + width: 16px; + height: 16px; +} +.scada-radio input { + position: absolute; + visibility: hidden +} +.scada-radio label { + position: absolute; + display: inline-block; + width: 16px; + height: 16px; + border: 1px solid #d7d7d7; + border-radius: 9px; +} +/*选中状态*/ +.nm-radio input:checked + label { + border: 1px solid #1baede; +} +.nm-radio input:checked + label:before { + content: ""; + position: absolute; + top: 3px; left: 3px; + width: 10px; + height: 10px; + border-radius: 5px; + background-color: #1baede; +}', ' + + + +const { createApp, createVNode, render } = Vue; +const app = createApp({}) +const Radios = { + template: ` +
+
+ + +
+
+ `, + props: { + fontColor: { + type: String, + default: ''#ffffff'' + }, + fontSize: { + type: Number, + default: 14 + }, + fontFamily: { + type: String, + default: ''宋体'' + }, + fontStyle: { + type: String, + default: ''normal'' + }, + width: { + type: Number, + default: 80 + }, + height: { + type: Number, + default: 35 + }, + unselectedBorderWidth: { + type: Number, + default: 1, + }, + unselectedBorderColor: { + type: String, + default: ''rgba(155, 155, 155, 1)'' + }, + unselectedBackColor: { + type: String, + default: ''rgba(255, 255, 255, 0)'' + }, + selectedBorderWidth: { + type: Number, + default: 1 + }, + selectedBorderColor: { + type: String, + default: ''rgba(74, 144, 226, 1)'' + }, + selectedBackColor: { + type: String, + default: ''rgba(255, 255, 255, 0)'' + }, + selectedInnerBorderWidth: { + type: Number, + default: 0 + }, + selectedInnerBorderColor: { + type: String, + default: ''rgba(74, 144, 226, 1)'' + }, + selectedInnerBackColor: { + type: String, + default: ''rgba(74, 144, 226, 1)'' + }, + unselectedDiameter: { + type: Number, + default: 16 + }, + selectedDiameter: { + type: Number, + default: 16 + }, + selectedInnerDiameter: { + type: Number, + default: 10 + }, + radioList: { + type: Array, + default: () => [] + }, + realValue: { + type: String, + default: '''' + } + }, + emits: ["change"], + computed: { + getStyle() { + // const { fontColor, fontSize, fontFamily, fontStyle, width, height, lineHeight, backgroundColor,strokeColor,strokeWidth } = this + const { width, height } = this; + return { + width: width + ''px'', + height: height + ''px'', + display: "flex", + "flex-direction": width > height ? "row" : "column", + "justify-content": "flex-start", + "align-items": width > height ? ''center'' : ''left'' + } + }, + getRadioOuter() { + const { selectedDiameter } = this; + return { + position: "relative", + width: selectedDiameter + ''px'', + height: selectedDiameter + ''px'', + flex: ''1'', + } + }, + getRadioInput() { + return { + position: ''absolute'', + visibility: ''hidden'' + } + }, + labelStyle() { + const { fontColor, fontSize, fontFamily, fontStyle, selectedDiameter, selectedInnerDiameter } = this; + const pos = (selectedDiameter - selectedInnerDiameter) / 2; + + const style = {}; + if (fontStyle) { + if (fontStyle.includes(''bold'')) { + style["font-weight"] = ''bolder''; + } + if (fontStyle.includes(''italic'')) { + style["font-style"] = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style["text-decoration"] = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style["text-decoration"] = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style["text-decoration"] = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style["text-decoration"] = ''line-through'' + } + } + + + return { + position: ''absolute'', + top: ''0px'', + left: pos + selectedDiameter + 5 + ''px'', + ''color'': fontColor, + ''font-size'': fontSize + ''px'', + ''font-family'': fontFamily, + height: ''100%'', + display: ''flex'', + ''align-items'': ''center'', + ...style, + } + }, + getRadioLabel: () => (item, radioList, unselectedBorderWidth, unselectedBorderColor, unselectedBackColor, + selectedBorderWidth, selectedBorderColor, selectedBackColor, + unselectedDiameter, selectedDiameter) => { + + if (radioList.length > 0) { + return { + position: ''absolute'', + left: ''0px'', + display: ''inline-block'', + width: item.checked === ''checked'' ? selectedDiameter + ''px'' : unselectedDiameter + ''px'', + height: item.checked === ''checked'' ? selectedDiameter + ''px'' : unselectedDiameter + ''px'', + "border-width": item.checked === ''checked'' ? selectedBorderWidth + ''px'' : unselectedBorderWidth + ''px'', + "border-color": item.checked === ''checked'' ? selectedBorderColor : unselectedBorderColor, + "border-style": "solid", + ''border-radius'': item.checked === ''checked'' ? (selectedDiameter + 2) / 2 + ''px'' : (unselectedDiameter + 2) / 2 + ''px'', + ''background-color'': item.checked === ''checked'' ? selectedBackColor : unselectedBackColor, + ''box-sizing'': ''content-box'', + ''cursor'': ''pointer'' + } + } + }, + getCheckedInner() { + const { + selectedInnerBorderWidth, selectedInnerBorderColor, selectedInnerBackColor, + selectedDiameter, selectedInnerDiameter } = this + const pos = (selectedDiameter - selectedInnerDiameter) / 2 + ''px'' + return { + position: ''absolute'', + top: pos, + left: pos, + width: selectedInnerDiameter + ''px'', + height: selectedInnerDiameter + ''px'', + ''border-radius'': selectedInnerDiameter / 2 + ''px'', + ''background-color'': selectedInnerBackColor, + ''border-width'': selectedInnerBorderWidth + ''px'', + ''border-color'': selectedInnerBorderColor, + ''border-style'': ''solid'', + ''box-sizing'': ''border-box'' + } + } + }, + setup(props, { emit }) { + const { ref, watch } = Vue + const myRadioList = ref([]) + const clickHandler = (item) => { + myRadioList.value.forEach((el) => { + if (el.value === item.value) { + el.checked = ''checked''; + } else { + el.checked = false + } + }) + emit("change", item.value); + } + + watch(() => props.radioList, (val) => { + myRadioList.value = val + }, { + immediate: true, + }) + + watch(() => props.realValue, (val) => { + if (val) { + myRadioList.value.forEach((el) => { + if (el.value === String(val)) { + el.checked = ''checked''; + } else { + el.checked = false + } + }) + } + }, { + immediate: true, + }) + + return { + clickHandler, + myRadioList + } + } +} + +class CustomRadiosNode extends HtmlResize.view { + oldProperties = {} + + setHtml(rootEl) { + const { properties, width, height, } = this.props.model; + + const { fontColor, fontSize, fontFamily, fontStyle, + unselectedBorderWidth, unselectedBorderColor, unselectedBackColor, + selectedBorderWidth, selectedBorderColor, selectedBackColor, + selectedInnerBorderWidth, selectedInnerBorderColor, selectedInnerBackColor, + unselectedDiameter, selectedDiameter, selectedInnerDiameter } = properties; + const { model, graphModel } = this.props; + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const { normalData } = properties.dynamic || {}; + const { defaultOptions } = normalData || {}; + let list = []; + if (defaultOptions) { + let opts = [] + if (typeof defaultOptions !== ''string'') { + opts = defaultOptions + } else { + opts = JSON.parse(defaultOptions); + } + list = window._.cloneDeep(opts).map((el, index) => { + if (index === 0) { + el.checked = ''checked'' + } else { + el.checked = false + } + return el; + }) + } + + let realValue = ""; + if (normalData) { + realValue = window.resolveScadaNewValue(normalData.defaultValue); + } + + const changeHandler = (e) => { + graphModel.eventCenter.emit("node:change", { + data: this.props.model, + e, + }); + } + + const instance = createVNode(Radios, { + realValue, + radioList: list, + fontColor, + fontSize, fontFamily, fontStyle, width, height, + unselectedBorderWidth, unselectedBorderColor, unselectedBackColor, + selectedBorderWidth, selectedBorderColor, selectedBackColor, + selectedInnerBorderWidth, selectedInnerBorderColor, selectedInnerBackColor, + unselectedDiameter, selectedDiameter, selectedInnerDiameter, + onChange: changeHandler + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const propertiesBack = window._.cloneDeep(properties); + // 由于事件change 会给properties 增加一个 event 属性(见目录scadaDashboard/Diagram/useDynamicEventsHandler),会引发属性的改变,导致组件重渲染。 + delete propertiesBack.event; + if (this.sameProps(propertiesBack)) { + return false + } + return true; + } +} + +class CustomRadiosModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''custom-radios-node'', + view: CustomRadiosNode, + model: CustomRadiosModel, +}) + +', NULL, 1001, NULL, 1699972072580583400, 1067246875800000001, 1703498149264, 1067246875800000001, 1721286641569, 't', '文字', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (109414855322202112, 'horizontal-cylinder-tank', '水平圆柱水箱', NULL, ' + + + + + + + + + + + + + + + + + + + + + + + + + + +', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","mode":"horizontal","format":"rgba","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}]},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "26bc86b7-4cb8-4819-823d-ff6ab145d902", + "type": "horizontal-cylinder-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "26bc86b7-4cb8-4819-823d-ff6ab145d902", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": false, + "unitColor": "rgba(74, 144, 226, 1)", + "nodeAlias": "水平圆柱水箱", + "showDefaultValue": false, + "fontSize": 12, + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const HorizontalCylinderTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(23 - (realValue / maxValue * 54)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class HorizontalCylinderTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(HorizontalCylinderTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class HorizontalCylinderTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''horizontal-cylinder-tank'', + view: HorizontalCylinderTankNode, + model: HorizontalCylinderTankModel, +}) + +', NULL, 1001, 1001, 1001, 1067246875800000001, 1706498194339, 1067246875800000001, 1721286641632, 't', '时间', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102613074350081, 'custom-actor-node', '人物', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "7ced8c7f-d9ec-45ab-8e85-cf5eb9ea03ea", + "type": "custom-actor-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "7ced8c7f-d9ec-45ab-8e85-cf5eb9ea03ea", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "人物", + "lineHeight": 12, + "fontStyle": "bold,italic,underline,line-through", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 人物 +class ActorModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + + style.fill = properties.fill || style.fill; + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class ActorView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + // 人物头部圆形 + const ellipseAttrs = { + ...style, + cx: x, + cy: y - 3/8 * height, + rx: 1/4 * width, + ry: 1/8 * height, + width, + height + } + // 人物肩膀横线 + const pathAAttrs = { + ...style, + d: `M ${x - 1/2 * width} ${y - 1/8 * height} L ${x + 1/2 * width} ${y - 1/8 * height}` + } + // 人物身体躯干竖线 + const pathBAttrs = { + ...style, + d: `M ${x} ${y - 1/4 * height} L ${x} ${y + 1/5 * height}` + } + // 人物左腿斜线 + const pathCAttrs = { + ...style, + d: `M ${x} ${y + 1/5 * height} L ${x - 1/2 * width} ${y + 1/2 * height}` + } + // 人物右腿斜线 + const pathDAttrs = { + ...style, + d: `M ${x} ${y + 1/5 * height} L ${x + 1/2 * width} ${y + 1/2 * height}` + } + // 人物透明背景板 + const bgAttrs = { + x: x - 1/5 * width, + y: y - 1/2 * height, + width: 2/5 * width, + height, + style: ''fill: transparent'' + } + return h(''g'', {}, [ + h(''ellipse'', { + ...ellipseAttrs, + }), + h(''path'', { + ...pathAAttrs, + }), + h(''path'', { + ...pathBAttrs + }), + h(''path'', { + ...pathCAttrs + }), + h(''path'', { + ...pathDAttrs + }), + h(''rect'', { + ...bgAttrs + }) + ] + ); + } +} + +lf.register({ + type: ''custom-actor-node'', + view: ActorView, + model: ActorModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148579, 1067246875800000001, 1721286640628, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (109414856106536960, 'vertical-cylinder-tank', '垂直圆柱水箱', NULL, ' + + + + + + + + + + + + + + + + + + + + + + + + + +', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"id":"u:678a2c313b7f","multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}],"id":"u:94b0e20f05da"},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","editorState":"default","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "438f6162-0d90-44bc-8504-a3fdc34df80d", + "type": "vertical-cylinder-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "438f6162-0d90-44bc-8504-a3fdc34df80d", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": true, + "unitColor": "rgba(74, 144, 226, 1)", + "showDefaultValue": false, + "nodeAlias": "垂直圆柱水箱", + "fontSize": 12, + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "unit": "", + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const VerticalCylinderTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(42 - (realValue / maxValue * 69)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class VerticalCylinderTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(VerticalCylinderTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class VerticalCylinderTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''vertical-cylinder-tank'', + view: VerticalCylinderTankNode, + model: VerticalCylinderTankModel, +}) + +', NULL, 1001, 1001, 1001, 1067246875800000001, 1706498194526, 1067246875800000001, 1721286642002, 't', '时间', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612441010177, 'custom-horizontal-arrow-node', '水平箭头', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "389e26f4-f9e4-4a70-831f-c4c0d8aab096", + "type": "custom-horizontal-arrow-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "389e26f4-f9e4-4a70-831f-c4c0d8aab096", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "水平箭头", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 水平双箭头 +class HorizontalArrowModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + } + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + +class HorizontalArrowView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1/3 * height; + const leftX = x - 1/2 * width; + const leftX2 = x - 1/5 * width; + const rightX = x + 1/2 * width; + const rightX2 = x + 1/5 * width; + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + // 右箭头 + [rightX2, y - 1/2 * ArrowHeight], + [rightX2, y - 1/2 * height], + [rightX, y], + [rightX2, y + 1/2 * height], + [rightX2, y + 1/2 * ArrowHeight], + // 左箭头 + [leftX2, y + 1/2 * ArrowHeight], + [leftX2, y + 1/2 * height], + [leftX, y], + [leftX2, y - 1/2 * height], + [leftX2, y - 1/2 * ArrowHeight], + ] + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ] + ); + } +} + +lf.register({ + type: ''custom-horizontal-arrow-node'', + view: HorizontalArrowView, + model: HorizontalArrowModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148428, 1067246875800000001, 1721286640735, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102613175013378, 'custom-leftarrow-node', '左箭头', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示值","option":"","name":"showDefaultValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"},{"body":[{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:5b89c331fe7e"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"${label}","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b","min":12}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","id":"u:f0e9dbf83675","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"}","inline":true,"wrapperComponent":"","visibleOn":"data.sendCommandMethod === ''codes''"},{"type":"input-text","label":"弹框标题","name":"dialogTitle","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"hiddenOn":"data.eventAction !== ''sendCommand''","joinValues":false},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","label":"复制组件ID","name":"allComponentList","id":"u:77a71866967a","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"equal"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"相等","test":"this.type === \"equal\"","scaffold":{"type":"equal","label":"相等","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"真假","test":"this.type === \"boolean\"","scaffold":{"type":"boolean","label":"真假","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb"},{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"字体","name":"fontColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"},{"label":"背景","name":"backColor","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"${''旋转''}","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue), ''animationName'': ''旋转'' }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data),''animationName'': ''旋转'' }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":1}],"data":{"animationCombo":[{"dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "fbdcb5dc-ee53-4468-8d7f-3e19daf04d92", + "type": "custom-leftarrow-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "fbdcb5dc-ee53-4468-8d7f-3e19daf04d92", + "width": 100, + "height": 100, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "strokeWidth": 1, + "showDefaultValue": false, + "showUnit": false, + "fontSize": 12, + "nodeAlias": "左箭头", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "[{ \"val\": 0.00 }]", + "unit": "" + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "{\"globalInputParamsCalculated\":[],\"device\":\"\",\"command\":\"\",\"eventAction\":\"sendCommand\",\"dataPointParamsCalculate\":\"return [\\n {\\n key: \\\"\\\",\\n value: ''''\\n }\\n]\",\"sendCommandMethod\":\"config\",\"inputParamsCalculate\":\"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\\nconst condition = {\\n deviceName: deviceInfo.code,\\n attrCode: command.controlDeviceAttr,\\n value: event == 0 ? 1 : event == 1 ? 0 : event\\n}\\nreturn {\\n \\\"condition\\\": JSON.stringify(condition),\\n \\\"controlId\\\": command.id\\n}\",\"requestMethod\":\"post\",\"requestUrl\":\"/thing/device/control/control\"}" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [] + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "animationTime": 3 + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏" + } + ] + } + } + } + } + ] +}', '', '// 左箭头 +class LeftArrowModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 100; + this.height = properties.height || 100; + this.text.editable = false; // 不允许文本被编辑 + window.nodeEventsListeners(this); + } + + setAttributes() { + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue) + this.realValue = realValue + const { showDefaultValue, showUnit } = properties + if(showDefaultValue) { + textValue += '' '' + realValue + } + if (showUnit) { + textValue += '' '' + normalData.unit + } + + }; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + + window.changeBackgroundColor(style, properties); + + + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + window.changeFontColor(style, properties); + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} +class LeftArrowView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height; + const leftX = x - 1 / 2 * width; + const leftX2 = x - 1 / 5 * width; + const rightX = x + 1 / 2 * width; + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [leftX2, y - 1 / 2 * ArrowHeight], + [leftX2, y - 1 / 2 * height], + [leftX, y], + [leftX2, y + 1 / 2 * height], + [leftX2, y + 1 / 2 * ArrowHeight], + [rightX, y + 1 / 2 * ArrowHeight], + [rightX, y - 1 / 2 * ArrowHeight], + ] + } + + return h(''g'', {}, [ + h(''polygon'', { ...attrs }) + ] + ); + } +} + +lf.register({ + type: ''custom-leftarrow-node'', + view: LeftArrowView, + model: LeftArrowModel +})', NULL, 1001, NULL, 1001, 1067246875800000001, 1703498148603, 1067246875800000001, 1721286640977, 't', '基础图形', 't', 't', NULL); +INSERT INTO "public"."iot_section_detail" VALUES (1739102614265532418, 'custom-image-node', '图片', 1, '', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:fc464664fb93","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:8a3fc64f07f6","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"container","id":"u:26f912c2e955","className":"m-b","body":[{"type":"button","label":"素材库","onEvent":{"click":{"actions":[{"dialog":{"type":"dialog","title":"素材库","body":[{"type":"service","body":[{"type":"tree-select","id":"u:23489352da59","label":"","name":"materialGroup","multiple":false,"placeholder":"选择素材组","className":"","size":"full","inputClassName":"","mode":"inline","source":{"url":"/thing/v1/group/iotgroupinfo/groupList","method":"get","messages":{},"dataType":"json","data":{"name":"","type":"material"},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"payload.data = payload.data.map((item) => {\r\n item.children = item.typeList\r\n return item\r\n}) \r\n\r\nreturn {\r\n ...payload,\r\n status: payload.code === 200 ? 0 : payload.code\r\n};"},"labelField":"name","valueField":"id","menuTpl":"
${name}
","clearable":true,"enableNodePath":false,"showIcon":true,"initiallyOpen":true},{"type":"search-box","label":"","name":"materialName","id":"u:6f40e3a06211","placeholder":"搜索素材名称","mode":"horizontal","size":"lg"},{"type":"pagination-wrapper","id":"u:1111a3e91978","inputName":"list","outputName":"list","perPage":20,"body":[{"type":"list-select","id":"u:f43228a4939a","source":"${list}","onEvent":{"change":{"actions":[{"componentId":"u:2ed59e5324ca","args":{"value":{"selectedPic":"${event.data.value}"}},"actionType":"setValue","stopPropagation":true}]}},"valueField":"image","name":"materialPics","listClassName":"custom-material-pics","multiple":false}],"position":"bottom"}],"id":"u:00abe4516cfa","messages":{},"api":{"url":"/thing/v1/material/page?name=${materialName}&groupIds=${materialGroup}","method":"get","messages":{},"dataType":"json","headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"data":{"order":"desc","orderField":"create_date","limit":9999},"adaptor":""}}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2ed59e5324ca","closeOnEsc":false,"size":"lg","data":{"selectedPic":"","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"className":"text-left","onEvent":{"confirm":{"actions":[{"actionType":"setValue","args":{"value":"${selectedPic}"},"componentId":"hrefNode"}]}}},"actionType":"dialog"}]}},"id":"u:5091647a1e0b","className":"className-5091647a1e0b"}],"style":{"position":"static","display":"flex","flexDirection":"row","flexWrap":"nowrap","justifyContent":"flex-end","alignItems":"stretch"},"wrapperBody":false,"isFixedHeight":false,"isFixedWidth":false},{"type":"input-text","label":"路径","name":"href","id":"hrefNode","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"switch","label":"显隐包含子节点","option":"","name":"showHideContainChildren","falseValue":false,"trueValue":true,"id":"u:9419f0a3785b","value":false,"mode":"horizontal"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","editorState":"default","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"单击","value":"click"},{"label":"双击","value":"dblClick"},{"label":"改变","value":"change"},{"label":"鼠标进入","value":"mouseEnter"},{"label":"鼠标离开","value":"mouseLeave"}],"id":"u:a7b44847011a","label":"名称"},{"type":"input-text","name":"config","placeholder":"事件配置","id":"u:d491386a95c2","onEvent":{"focus":{"actions":[{"actionType":"dialog","dialog":{"title":"设置事件","data":{"comboIndex":"${index}","&":"${config | toJson}","nodesList":"${graphDataList}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","evType":"${eventType}"},"body":[{"type":"form","title":"表单","body":[{"type":"radios","label":"事件行为","name":"eventAction","options":[{"label":"打开链接","value":"openLink"},{"label":"打开弹窗","value":"openDialog"},{"label":"下发指令","value":"sendCommand"},{"label":"显示隐藏","value":"showHide"}],"mode":"horizontal","horizontal":{"leftFixed":"sm"},"id":"u:9e7f1220367f","value":"openLink"},{"type":"input-text","label":"链接地址","name":"linkAddress","mode":"horizontal","horizontal":{"leftFixed":"sm"},"inputClassName":"w-full","id":"u:c5bda965ed3c","size":"full","visibleOn":"data.eventAction === ''openLink''"},{"type":"combo","label":"参数","name":"dataPointTable","id":"dataPointTable","addable":true,"strictMode":true,"removable":true,"horizontal":{"leftFixed":"sm"},"multiple":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bf2f6c98dbff"},"items":[{"type":"input-text","name":"dataPoint","id":"u:1eb050ec98d3","label":"","multiple":false,"size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"left":2,"right":10},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"select","label":"设备","name":"devices","id":"u:1cdb908c23a8","multiple":false,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"const selectedItems = event.data.selectedItems;\r\n if(selectedItems) { doAction({actionType: ''setValue'', componentId: ''u:51f0e51abd7c'', args: { value: { attrs: selectedItems.attrs, deviceCode: selectedItems.deviceCode } } }); }"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10}},{"type":"select","label":"数据点","name":"dataPoint","id":"u:8147daea685d","multiple":true,"mode":"horizontal","size":"md","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}"},"submitText":""}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","dataPointTableIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"componentId":"dataPointTable","actionType":"setValue","args":{"value":{"dataPoint":"${event.data | json}"},"index":"${index}"}}]}}}}]}},"horizontal":{"left":1,"right":11}}],"syncFields":[],"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"editor","label":"参数计算","name":"dataPointParamsCalculate","id":"u:4d5e749b7f42","visibleOn":"data.eventAction === ''openLink''","className":"text-left m-b-xs","inputClassName":"w-full","language":"javascript","value":"return [\n {\n key: \"\",\n value: ''''\n }\n]"},{"type":"radios","label":"打开方式","name":"openMethod","id":"u:eec4f8737fe8","options":[{"label":"打开新页面","value":"openNewPage"},{"label":"打开到本页","value":"openLocalPage"}],"horizontal":{"leftFixed":"sm"},"mode":"horizontal","visibleOn":"data.eventAction === ''openLink''"},{"type":"radios","label":"下发指令方式","name":"sendCommandMethod","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:82d9feb7609d","options":[{"label":"配置","value":"config"},{"label":"代码","value":"codes"}],"value":"config"},{"type":"select","label":"选择设备","clearable":"true","name":"selectDevice","id":"u:891bca3a0150","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''device'': select }} })"}]}},"hiddenOn":"data.eventAction !== ''sendCommand''","inputClassName":"w-full","multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/device","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"}},"labelField":"name","valueField":"id"},{"type":"select","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:42026703278d","label":"选择指令","clearable":"true","name":"selectCommand","onEvent":{"change":{"actions":[{"componentId":"u:a13b61f23669","actionType":"custom","script":"const select = event.data.selectedItems; \r\n doAction({''componentId'': ''u:a13b61f23669'', ''actionType'': ''setValue'', ''args'': { ''value'': { ''command'': select }} })"}]}},"multiple":false,"mode":"horizontal","size":"full","source":{"url":"/thing/device/control/list/${selectDevice}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.selectDevice"},"labelField":"name","valueField":"id","inputClassName":"w-full"},{"type":"tpl","hiddenOn":"data.eventAction !== ''sendCommand''","id":"u:f0e9dbf83675","className":"mx-20 text-left","tpl":"function (deviceInfo, command, event){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:14d8542a2066","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left m-b-xs","label":"入参","name":"inputParamsCalculate","inputClassName":"w-full","language":"javascript","onEvent":{"blur":{"actions":[{"actionType":"custom","script":"const func = new Function(''paramsList'', ''command'', event.data.value);\n const newParams = func(event.data.__super.inputParamsTable || [], event.data.__super.selectCommand);\n doAction({actionType: ''setValue'', componentId: ''u:a13b61f23669'', args: { value: { globalInputParamsCalculated: newParams } } });"}]}},"value":"// console.log(''deviceInfo'', deviceInfo, ''command'', command, ''event'', event);\n// 入参提示: deviceInfo -- 设备信息,command -- 指令信息, event -- 事件传参(当前部件所绑定的立即值,或当前部件经过计算后的自定义值), 入参计算。。。然后返回出参\nreturn {\n \"condition\": \"\",\n \"controlId\": command.id,\n \"event\": event\n}"},{"type":"grid","id":"u:68833f10e2bf","columns":[{"body":[{"type":"select","label":"请求地址","name":"requestMethod","options":[{"label":"get","value":"get"},{"label":"post","value":"post"},{"label":"put","value":"put"},{"label":"delete","value":"delete"}],"id":"u:7c48788db8af","multiple":false,"hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","mode":"horizontal","size":"full","inputClassName":"w-full","value":"post"}],"id":"u:d9d274b50340"},{"body":[{"type":"input-text","label":false,"name":"requestUrl","id":"u:841b001e3bcd","size":"full","placeholder":"请输入请求地址","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''","value":"/thing/device/control/control"}],"id":"u:c8fab8bb0860"},{"body":[{"type":"input-number","label":"","name":"requestIntervalNumber","keyboard":true,"id":"u:69a53fa6dc9f","step":1,"mode":"inline","placeholder":"请求间隔","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"},{"type":"select","label":"","name":"requestIntervalUnit","options":[{"label":"秒","value":"second"},{"label":"分","value":"minute"},{"label":"时","value":"hour"},{"label":"天","value":"day"}],"id":"u:69f93c61c28b","multiple":false,"mode":"inline","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''config''"}],"id":"u:1827f27e041b"}]},{"type":"grid","id":"u:208413b258dc","className":"m-b","columns":[]},{"type":"tpl","id":"u:931d6b4e0374","className":"mx-20 text-left","hiddenOn":"data.eventAction !== ''sendCommand''","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"function (context, service, command, event ){","inline":true,"wrapperComponent":""},{"type":"editor","id":"u:52152e74a360","hiddenOn":"data.eventAction !== ''sendCommand''","className":"text-left","visibleOn":"data.sendCommandMethod === ''codes''","label":"下发指令","name":"commandContent","inputClassName":"w-full","language":"javascript","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"函数入参为:","content":"''context'': logicflow 上下文实例; \n ''service'': axios 请求实例;"}},{"type":"tpl","id":"u:2bb06db3ddd9","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","visibleOn":"data.sendCommandMethod === ''codes''","tpl":"}","inline":true,"wrapperComponent":""},{"type":"input-text","id":"u:efa5bfe4e760","hiddenOn":"data.eventAction !== ''openDialog''","label":"弹框标题","name":"dialogTitle"},{"type":"input-text","label":"弹框内容","name":"dialogContent","id":"u:e1ee364f3318","hiddenOn":"data.eventAction !== ''openDialog''"},{"type":"list-select","label":"指令下一步","name":"commandNext","id":"u:158bf05d1e6b","hiddenOn":"data.eventAction !== ''sendCommand''","multiple":true,"options":[{"label":"显示隐藏","value":"showOrHide"}],"joinValues":false},{"type":"combo","label":"选择变量","name":"operateVariables","id":"u:a4352d57fdad","multiple":true,"mode":"horizontal","visibleOn":"data.eventAction === ''operateVariable''","addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:f1307c109572"},"items":[{"type":"select","name":"selectedVariable","placeholder":"选择变量","selectMode":"chained","id":"u:309c8645978d","searchable":true,"multiple":false,"size":"full","source":"${nodesList || graphDataList}","mode":"horizontal","inputClassName":"","className":"","label":false},{"type":"tpl","id":"u:0d7912942b0f","hiddenOn":"data.eventAction !== ''sendCommand''","className":"mx-20 text-left","tpl":"","inline":true,"wrapperComponent":""},{"type":"editor","name":"newValue","id":"u:6811d0fb2211","mode":"horizontal","label":false,"placeholder":"新值","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"此函数入参包括四个, 按照顺序依次为:inputParamsTable:下发指令的入参;globalInputParamsCalculated: 是下发指令的 ”入参计算“ 返回值;response :下发指令请求的返回值; event: 事件。 根据此四个变量,计算需要操作的变量新值"}],"strictMode":true,"syncFields":[],"inputClassName":"w-full","size":"full"},{"type":"grid","id":"u:f9985214eb9e","columns":[{"body":[{"type":"editor","name":"showHideNewValue","id":"u:9f2d894d8fc6","mode":"horizontal","label":false,"placeholder":"返回计算后的组件显示和隐藏, 格式为: return { ''组件id xxxxx-xxx-xxx'': ''show'' / ''hide'' } 或 return { ''组件id xxxxx-xxx-xxx'': e ? ''show'' : ''hide'' } , e为事件值。","size":"full","language":"javascript","inputControlClassName":"w-full","remark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top"},"description":"","visibleOn":"data.eventAction === ''showHide''","className":"w-full","inputClassName":"w-full","value":""}],"id":"u:52e0c15d0c8f"}],"className":"m-b"},{"type":"list-select","id":"u:77a71866967a","label":"复制组件ID","name":"allComponentList","mode":"horizontal","visibleOn":"data.eventAction === ''showHide''","multiple":false,"source":"${nodesList || graphDataList}","onEvent":{"change":{"actions":[{"actionType":"copy","args":{"content":"${event.data.value}"}}]}}},{"type":"grid","id":"u:7e8dfba20aee","columns":[]}],"id":"u:a13b61f23669","name":"eventsForm","className":"text-left","data":{"globalInputParamsCalculated":[],"device":"${device}","command":"${command}"}}],"onEvent":{"confirm":{"actions":[{"componentId":"u:364496dd313b","actionType":"custom","script":"const evType = event.data.eventType || event.data.__super.evType; \r\n const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:364496dd313b'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''config'': JSON.stringify(event.data), ''eventType'': evType }} })"}]}},"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:57f536c19373","size":"lg","type":"dialog","bodyClassName":"setting-events-dialog","name":"settingEventsDialog"}}]}},"label":"动作","editorState":"default"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","className":"border-none","id":"u:6d4a75088bc2"}}],"data":{"eventCombo":[{"eventType":"click","enable":false,"config":""},{"eventType":"dblClick","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''uiDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"rangeImage"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"范围/颜色","test":"this.type === \"rangeColor\"","scaffold":{"type":"rangeColor","label":"范围/颜色","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"label":"颜色","name":"color","type":"input-color","id":"u:5148d38928d9","format":"rgba","inputClassName":"myColorPick","static":false,"placeholder":"选择颜色"}]},{"label":"布尔/图片","test":"this.type === \"booleanImage\"","scaffold":{"type":"booleanImage","label":"布尔/图片","name":""},"items":[{"label":"真假","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"true/false"},{"type":"static-image","class":"cursor-pointer","width":"50px","height":"50px","mode":"horizontal","canAccessSuperData":true,"name":"imageUrl","clickAction":{"actionType":"dialog","dialog":{"type":"dialog","title":"素材库","body":[{"type":"service","body":[{"type":"tree-select","id":"u:23489352da59","label":"","name":"materialGroup","multiple":false,"placeholder":"选择素材组","className":"","size":"full","inputClassName":"","mode":"inline","source":{"url":"/thing/v1/group/iotgroupinfo/groupList","method":"get","messages":{},"dataType":"json","data":{"name":"","type":"material"},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"payload.data = payload.data.map((item) => {\r\n item.children = item.typeList\r\n return item\r\n}) \r\n\r\nreturn {\r\n ...payload,\r\n status: payload.code === 200 ? 0 : payload.code\r\n};"},"labelField":"name","valueField":"id","menuTpl":"
${name}
","clearable":true,"enableNodePath":false,"showIcon":true,"initiallyOpen":true},{"type":"search-box","label":"","name":"materialName","id":"u:6f40e3a06211","placeholder":"搜索素材名称","mode":"horizontal","size":"lg"},{"type":"pagination-wrapper","id":"u:1111a3e91978","inputName":"list","outputName":"list","perPage":20,"body":[{"type":"list-select","id":"u:f43228a4939a","source":"${list}","onEvent":{"change":{"actions":[{"componentId":"u:c92fdccb153e","actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:c92fdccb153e'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''type'': ''booleanImage'', ''imageUrl'': event.data.value }} });"}]}},"valueField":"image","name":"materialPics","listClassName":"custom-material-pics","multiple":false}],"position":"bottom","canAccessSuperData":true}],"id":"u:00abe4516cfa","messages":{},"api":{"url":"/thing/v1/material/page?name=${materialName}&groupIds=${materialGroup}","method":"get","messages":{},"dataType":"json","headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"data":{"order":"desc","orderField":"create_date","limit":9999},"adaptor":""},"canAccessSuperData":true}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"materialLib","closeOnEsc":false,"size":"lg","data":{"selectedPic":"","comboIndex":"${index}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"className":"text-left","actions":[]}},"strictMode":false,"syncFields":["imageUrl"],"label":"图片","id":"u:7cfff1959aca"}]},{"label":"范围/图片","test":"this.type === \"rangeImage\"","scaffold":{"type":"rangeImage","label":"范围/图片","name":""},"items":[{"label":"起始","name":"from","type":"input-number","precision":2,"id":"u:6f9362ce0efb"},{"label":"结束","name":"to","type":"input-number","precision":2,"id":"u:32b3714b545b"},{"type":"static-image","class":"cursor-pointer","width":"50px","height":"50px","mode":"horizontal","canAccessSuperData":true,"name":"imageUrl","clickAction":{"actionType":"dialog","dialog":{"type":"dialog","title":"素材库","body":[{"type":"service","body":[{"type":"tree-select","id":"u:23489352da59","label":"","name":"materialGroup","multiple":false,"placeholder":"选择素材组","className":"","size":"full","inputClassName":"","mode":"inline","source":{"url":"/thing/v1/group/iotgroupinfo/groupList","method":"get","messages":{},"dataType":"json","data":{"name":"","type":"material"},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"payload.data = payload.data.map((item) => {\r\n item.children = item.typeList\r\n return item\r\n}) \r\n\r\nreturn {\r\n ...payload,\r\n status: payload.code === 200 ? 0 : payload.code\r\n};"},"labelField":"name","valueField":"id","menuTpl":"
${name}
","clearable":true,"enableNodePath":false,"showIcon":true,"initiallyOpen":true},{"type":"search-box","label":"","name":"materialName","id":"u:6f40e3a06211","placeholder":"搜索素材名称","mode":"horizontal","size":"lg"},{"type":"pagination-wrapper","id":"u:1111a3e91978","inputName":"list","outputName":"list","perPage":20,"body":[{"type":"list-select","id":"u:f43228a4939a","source":"${list}","onEvent":{"change":{"actions":[{"componentId":"u:c92fdccb153e","actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; \r\n doAction({''componentId'': ''u:c92fdccb153e'', ''actionType'': ''setValue'', ''args'': { ''index'': index, ''value'': { ''type'': ''rangeImage'', ''imageUrl'': event.data.value }} });"}]}},"valueField":"image","name":"materialPics","listClassName":"custom-material-pics","multiple":false}],"position":"bottom","canAccessSuperData":true}],"id":"u:00abe4516cfa","messages":{},"api":{"url":"/thing/v1/material/page?name=${materialName}&groupIds=${materialGroup}","method":"get","messages":{},"dataType":"json","headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"data":{"order":"desc","orderField":"create_date","limit":9999},"adaptor":""},"canAccessSuperData":true}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"materialLib","closeOnEsc":false,"size":"lg","data":{"selectedPic":"","comboIndex":"${index}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"className":"text-left","actions":[]}},"strictMode":false,"syncFields":["imageUrl"],"label":"图片","id":"u:7cfff1959aca"}],"canAccessSuperData":true}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"显示/隐藏","body":[{"type":"service","id":"u:fed27a06a9ce","body":[{"type":"combo","id":"hiddenCombo","label":"","name":"hiddenCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"showOrHiddenName","label":"","id":"u:61d49c5acb77","borderMode":"none","value":"${index === 0 ? ''隐藏'' : ''显示''}","readOnly":true}],"id":"u:ea4bc33a4fcb"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:1f58747ec3e6","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:2c37d59dc3fc","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''hiddenCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","editorState":"default"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:d97eb93589c9","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:2cfc36ebe439","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:eb05d4b8ed36","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:d1187ed5b0ca"}],"id":"u:82fb0182df72","className":"flex-auto"}],"id":"u:27d29971018c","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"maxLength":2}],"data":{"hiddenCombo":[{"dataPoint":"","min":"","max":""}]},"name":"hiddenService"}],"id":"u:fe703d82df8b","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"动效","id":"u:379a620b2bbc","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none","body":[{"type":"service","id":"u:594a746a7e96","body":[{"type":"combo","id":"animationCombo","label":"","name":"animationCombo","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:bab0356b2e63"},"items":[{"type":"flex","justify":"space-between","items":[{"type":"input-text","name":"animationName","label":"","id":"u:1cfdcc5ad7c7","borderMode":"none","value":"","readOnly":true}],"id":"u:e3990e007f9c"},{"type":"flex","justify":"space-between","items":[{"type":"select","label":"速度","name":"animationTime","visibleOn":"this.index === 0","menuTpl":"
${value}秒","options":[{"label":"0.5","value":"0.5"},{"label":"1","value":"1"},{"label":"2","value":"2"},{"label":"3","value":"3"},{"label":"4","value":"4"},{"label":"5","value":"5"},{"label":"6","value":"6"},{"label":"7","value":"7"},{"label":"8","value":"8"}],"id":"u:f9762c0602ce","marks":{},"mode":"horizontal","multiple":false,"className":"w-full"}],"id":"u:18969f044f61"},{"type":"input-text","label":"数据点","name":"dataPoint","id":"u:995482efad18","clearable":true,"multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:04e78b30faf4","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}","comboIndex":"${index}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const index = event.data.__index | event.data.__super.comboIndex; const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(newValue) }, ''index'': index } }) } else {doAction({ ''componentId'': ''animationCombo'', ''actionType'': ''setValue'', ''args'': { value: { ''dataPoint'': JSON.stringify(event.data) }, ''index'': index } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","editorState":"default"},{"type":"flex","items":[{"type":"tpl","tpl":"范围","id":"u:9707cde74e11","className":"w-28"},{"type":"flex","justify":"space-between","alignItems":"center","items":[{"type":"input-number","precision":2,"name":"min","label":"","id":"u:ec526d2df0ee","keyboard":true,"step":1,"className":"m-none"},{"type":"tpl","tpl":" — ","id":"u:534114ea71cb","className":"mx-2"},{"type":"input-number","precision":2,"name":"max","label":"","id":"u:39bce4d2d60b"}],"id":"u:4a2208febcd4","className":"flex-auto"}],"id":"u:8ec6ca9fe14f","justify":"space-between","alignItems":"center","className":"w-full"}],"deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:502b68dfba77","className":"absolute right-2 border-none"},"canAccessSuperData":true,"maxLength":2}],"data":{"animationCombo":[{"animationName":"闪烁","dataPoint":"","min":"","max":""},{"animationName":"旋转","dataPoint":"","min":"","max":""}]},"name":"animationService"}]}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}],"id":"u:edef8e21c1e3","justify":"flex-end"},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left","messages":{}}],"id":"u:dc8d331cbe5e","className":"h-full"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "c04eb8bb-49d7-46c2-9804-15be1334b01f", + "type": "custom-image-node", + "x": 202, + "y": 200, + "text": { + "value": "", + "x": 202, + "y": 200 + }, + "properties": { + "id": "c04eb8bb-49d7-46c2-9804-15be1334b01f", + "width": 100, + "height": 100, + "x": 202, + "y": 200, + "rotation": 0, + "opacity": 1, + "showHideContainChildren": false, + "showDefaultValue": false, + "showUnit": false, + "strokeWidth": 1, + "fontSize": 12, + "borderDirection": "border", + "nodeAlias": "图片", + "href": "./defaultPic.svg", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "rangeImage", + "label": "范围/图片", + "name": "" + } + ], + "defaultValue": "[]", + "unit": "" + }, + "uiData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [ + { + "type": "rangeImage", + "label": "范围/图片", + "name": "" + } + ], + "defaultValue": "[]" + }, + "animationData": { + "animationCombo": [ + { + "min": "", + "max": "", + "animationName": "旋转", + "defaultValue": "[]", + "animationTime": 3, + "dataPoint": "" + }, + { + "min": "", + "max": "", + "animationName": "闪烁", + "defaultValue": "[]", + "dataPoint": "" + } + ] + }, + "hiddenData": { + "hiddenCombo": [ + { + "dataPoint": "", + "min": "", + "max": "", + "showOrHiddenName": "隐藏", + "defaultValue": "[]" + }, + { + "defaultValue": "[]", + "showOrHiddenName": "显示", + "dataPoint": "" + } + ] + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "click", + "enable": false, + "config": "" + }, + { + "eventType": "dblClick", + "enable": false, + "config": "" + } + ] + } + } + } + } + ] +}', '', 'const isLocal = window.location.origin.includes(''localhost''); + +const defaultPic = isLocal ? window.location.origin + ''/defaultPic.svg'' : window.location.origin + ''/scada/defaultPic.svg''; + +// 图片-基础节点 +class ImageModel extends RectResize.model { + realValue = '''' + + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + super.initNodeData(data) + const { properties } = this; + this.width = properties.width || 150; + this.height = properties.height || 80; + window.nodeEventsListeners(this); + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + const { x, y, properties } = this; + const { href, textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties; + const { normalData } = dynamic || {}; + let textValue = properties.content || ''''; + if (normalData) { + const { defaultValue } = normalData || {} + const realValue = window.resolveScadaNewValue(defaultValue); + this.realValue = realValue; + } + + const img = new Image() + img.onerror = () => { + properties.href = '''' + } + img.src = href + + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: textValue, + } + } + + getNodeStyle() { + const style = super.getNodeStyle(); + const { properties } = this; + + style.fill = properties.fill || style.fill; + style.stroke = properties.strokeColor || style.stroke; + style.strokeWidth = properties.strokeWidth || style.strokeWidth; + style.opacity = properties.opacity || 1; + return style; + } + + getTextStyle() { + const style = super.getTextStyle(); + const { properties } = this; + style.color = properties.fontColor || style.color; + style.fontSize = properties.fontSize || style.fontSize; + const fontStyle = properties.fontStyle; + if(fontStyle) { + if (fontStyle.includes(''bold'')) { + style.fontWeight = ''bolder''; + } + if(fontStyle.includes(''italic'')) { + style.fontStyle = ''italic'' + } + if (fontStyle.includes(''underline,line-through'')) { + style.textDecoration = ''underline line-through'' + } else if (fontStyle.includes(''line-through,underline'')) { + style.textDecoration = ''line-through underline'' + } else if (fontStyle.includes(''underline'')) { + style.textDecoration = ''underline'' + } else if (fontStyle.includes(''line-through'')) { + style.textDecoration = ''line-through'' + } + } + return style; + } + + getResizeOutlineStyle() { + return { + stroke: "#00ffff", + strokeWidth: 1, + strokeDasharray: "none", + }; + } +} + + +class ImageNode extends RectResize.view { + getImageHref(href) { + return href; + } + + getResizeShape() { + const { x, y, width, height, properties } = this.props.model + const finalWidth = width <= 10 ? 10 : width + const finalHeight = height <= 10 ? 10 : height + const { opacity, blinkAnimation } = properties; + let href = this.getImageHref(properties.href || defaultPic.replace(null, '''')) + + const { uiData } = properties.dynamic || {}; + if (uiData) { + const realValue = window.resolveScadaNewValue(uiData.defaultValue) + if(realValue !== '''') { + uiData.conditionVariables.forEach((item) => { + if (item.type === ''rangeImage'') { + let from = item.from; + let to = item.to; + if (item.from >= item.to) { + from = item.to; + to = item.from; + } + if (item.imageUrl && Number(realValue) >= from && Number(realValue) <= to) { + href = item.imageUrl; + } + } else if (item.type === ''booleanImage'') { + const trueFlags = [''true'', true] + const falseFlags = [''false'', false] + const truetrue = trueFlags.includes(item.value) && trueFlags.includes(realValue) + const falsefalse = falseFlags.includes(item.value) && falseFlags.includes(realValue) + if (truetrue || falsefalse) { + href = item.imageUrl; + } + } + }) + } + } + const finalX = x - 1 / 2 * finalWidth; + const finalY = y - 1 / 2 * finalHeight + const attrs = { + x: finalX, + y: finalY, + width: finalWidth, + height: finalHeight, + href, + opacity, + className: blinkAnimation ? ''blinkAnim'' : '''', + transformOrigin: `${finalX + finalWidth/2} ${finalY + finalHeight/2}`, + // 根据宽高缩放 + preserveAspectRatio: ''none meet'' + } + return h(''g'', {}, [ + h(''image'', { ...attrs }) + ] + ); + } +} + +lf.register({ + type: ''custom-image-node'', + view: ImageNode, + model: ImageModel +})', '', 1001, NULL, 1001, 1067246875800000001, 1703498148862, 1067246875800000001, 1721286641570, 't', '基础图形', 't', 't', ' // 数据处理, 返回格式如下 + +return { + normalData: [], + uiData: [], + animationData: [[]], // 多级 + hiddenData: [[]], // 多级 +} '); +INSERT INTO "public"."iot_section_detail" VALUES (109414856052011008, 'rectangle-tank', '矩形水箱', NULL, ' + + + + + + + + + + + + + + + + + + + +', 'svg', '{"type":"page","id":"u:270584784ce1","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","mode":"horizontal","format":"rgba","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}]},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"source":"${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:1cdb908c23a8'', ''args'': {''value'': ''''} });\r\n doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"clearable":true,"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=${dataSource}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log(''payload.data.result'', payload.data.result); \r\n const list = []\r\n const devices = payload.data.result.info \r\n for (const key in devices) {\r\n const device_info = devices[key] \r\n list.push({\r\n label: device_info.entityName,\r\n value: device_info.entityId,\r\n deviceCode: device_info.entityCode,\r\n deviceInfo: device_info,\r\n attrs: device_info.attrs })\r\n }\r\n payload.data = list;\r\n return payload\r\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({''actionType'': ''setValue'', ''componentId'': ''u:8147daea685d'', ''args'': {''value'': ''''} }); }"}]}},"responseData":{"&":"$$","list":"${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=${dataSource}&entityId=${devices}","method":"get","messages":{},"headers":{"token":"${myToken}","tenantCode":"${myTenantCode}","companyId":"${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\r\n item.dictName = item.dictName + '' - '' + item.dictCode\r\n return item\r\n})\r\npayload.data = list;\r\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"${deviceCode || ''''}","devices":"${devices || ''''}","dataPoint":"${dataPoint || ''''}","dataSource":"${dataSource || ''''}","deviceAttrs":"${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split('',''); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ ''actionType'': ''setValue'', ''componentId'': ''u:51f0e51abd7c'', ''args'': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"${dataPoint | toJson}","apiDtoList":"${thingApiDTOList}","myToken":"${myToken}","myTenantCode":"${myTenantCode}","myCompanyId":"${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''''; let dataPoint = ''''; if(tableData) { tableData.forEach(item => { devices += (item.devices + '','');dataPoint += (item.dataPoint + '',''); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(newValue) } }) } else {doAction({ ''componentId'': ''normalDataPoint'', ''actionType'': ''setValue'', ''args'': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \"val\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "f5249efb-9723-4132-8977-91179790ec59", + "type": "rectangle-tank", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "f5249efb-9723-4132-8977-91179790ec59", + "width": 200, + "height": 200, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "showValue": true, + "valueColor": "rgba(74, 144, 226, 1)", + "warnColor": "rgba(245, 166, 35, 1)", + "seriousColor": "rgba(208, 2, 27, 1)", + "showUnit": true, + "unitColor": "rgba(74, 144, 226, 1)", + "nodeAlias": "矩形水箱", + "showDefaultValue": false, + "fontSize": 12, + "strokeColor": "#242770", + "liquidColor": "#7A8BFF", + "valueType": "ratio", + "valueFontSize": 16, + "maxValue": 100, + "warnValue": 75, + "seriousValue": 90, + "unitFontSize": 12, + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "" + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const defaultVal = 62; + +const RectangleTank = { + template: `
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ {{valueStr}}{{unitStr}} +
+
+
+`, + props: { + chartId: { + type: String, + default: '''' + }, + currentData: { + type: Number, + default: 100 + }, + width: { + type: Number, + default: 350 + }, + height: { + type: Number, + default: 150 + }, + chartProps: { + type: Object, + default: () => { } + }, + thingName: { + type: String, + default: '''' + }, + attr: { + type: String, + default: '''' + }, + unit: { + type: String, + default: '''' + }, + }, + computed: { + getTitleStyle() { + return { + position: ''absolute'', + top: ''0px'', + bottom: `0px`, + width: ''100%'', + zIndex: 100, + display: ''flex'', + justifyContent: ''center'', + alignItems: ''center'' + } + } + }, + setup(props) { + const { computed, ref, watch, toRefs, nextTick } = Vue; + const { chartProps, currentData, thingName, attr, width, height } = toRefs(props); + + let valueStr = ref(''''); + let unitStr = ref(''''); + let finalLiquidColor = ref(''#7A8BFF''); + let finalStrokeColor = ref("#242770"); + + const updateChart = (realValue, properties) => { + const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties; + const ratio = (realValue / maxValue * 100).toFixed(2); + if (showValue) { + if (valueType === ''ratio'') { + valueStr.value = ratio + '''' + showUnit && (unitStr.value = ''%'') + } else { + valueStr.value = realValue + '''' + showUnit && (unitStr.value = unit) + } + } + finalLiquidColor.value = liquidColor; + finalStrokeColor.value = strokeColor; + if (seriousValue && realValue >= seriousValue) { + finalLiquidColor.value = seriousColor + } else if (warnValue && realValue >= warnValue) { + finalLiquidColor.value = warnColor + } + setTimeout(() => { + const tankNode = document.getElementById(props.chartId); + const liquidLevel = Math.round(25 - (realValue / maxValue * 58)); + tankNode.style.transform = `translateY(${liquidLevel}%)`; + }, 50) + } + + watch([currentData, chartProps], ([val, properties]) => { + nextTick(() => { + updateChart(val, properties) + }) + }, { + immediate: true, + deep: true, + }) + + const valueStyle = computed(() => { + return { + color: chartProps.value.valueColor, + fontSize: chartProps.value.valueFontSize + ''px'' + } + }) + + const unitStyle = computed(() => { + return { + color: chartProps.value.unitColor, + fontSize: chartProps.value.unitFontSize + ''px'', + marginLeft: ''3px'' + } + }) + + return { + valueStyle, + unitStyle, + valueStr, + unitStr, + finalLiquidColor, + finalStrokeColor, + } + } +} + +class RectangleTankNode extends HtmlResize.view { + realValue = defaultVal + oldProperties = {} + chartRendered = false + instance = null + + setHtml(rootEl) { + if (!rootEl) return; + const { properties, width, height } = this.props.model; + const { normalData } = properties.dynamic || {} + let thingName = ''pressure''; + let attr = ''score''; + if (normalData && normalData.dataPoint) { + const dataPointStrParsed = JSON.parse(normalData.dataPoint || ''{}'') + const { deviceCode, dataPoint } = dataPointStrParsed; + thingName = deviceCode; + attr = dataPoint.split('','')[0]; + } + if (this.instance) { + // 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。 + Object.assign(this.instance.component.props, { + name: properties.nodeAlias, + chartId: `liquidlevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + return + } + const el = document.createElement(''div''); + rootEl.innerHTML = ''''; + const instance = createVNode(RectangleTank, { + name: properties.nodeAlias, + chartId: `liquidLevel-${properties.id}`, + currentData: this.realValue, + width, + height, + chartProps: properties, + thingName, + attr, + }) + instance.appContext = app._context + render(instance, el) + rootEl.appendChild(el); + this.instance = instance; + } + + sameProps(properties) { + const isSame = window._.isEqual(this.oldProperties, properties); + if (isSame) return true; + this.oldProperties = properties; + return false + } + + // 生命周期 支持重写内容, 但格式需一致 + shouldUpdate() { + const { properties } = this.props.model; + const { normalData } = properties.dynamic || {}; + + if (normalData && !normalData.dataPoint && !normalData.defaultValue) { + this.realValue = defaultVal; + return true + } + + if (normalData) { + const { defaultValue } = normalData || {}; + if (defaultValue) { + const realValue = window.resolveScadaNewValue(defaultValue) + if (this.realValue !== Number(realValue)) { + this.realValue = Number(realValue); + return true; + } + } + } + + const propertiesBack = window._.cloneDeep(properties); + if (propertiesBack.dynamic.normalData) { + const isSameProps = this.sameProps(propertiesBack); + if (isSameProps && this.chartRendered) { + return false + } else { + if (!this.chartRendered) { + this.chartRendered = true + return true + } + if (!isSameProps) { + return true; + } + } + } + } + + updateHtml() { + this.setHtml(this.rootEl); + } + + componentDidMount() { + // 防止拖动时候频繁渲染图表 + this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500); + if (this.shouldUpdate()) { + this.setHtml(this.rootEl); + } + } + + componentDidUpdate() { + if (this.shouldUpdate()) { + this.updateHtmlDebounced(); + } + } +} + +class RectangleTankModel extends HtmlResize.model { + initNodeData(data) { + // 自定义组件,需最开始重置一下text 。 + data.text = { + value: "", + x: data.x, + y: data.y, + }; + + super.initNodeData(data); + const { properties } = this; + this.width = properties.width || 80; + this.height = properties.height || 35; + this.text.editable = false; // 不允许文本被编辑 + } + + setAttributes() { + // 自定义组件需重置 text + const { x, y, properties } = this; + const { textHorizontalMove = 0, textVerticalMove = 0 } = properties; + this.text = { + ...this.text, + x: x + textHorizontalMove, + y: y + textVerticalMove, + value: "", + } + } +} + +lf.register({ + type: ''rectangle-tank'', + view: RectangleTankNode, + model: RectangleTankModel, +})', NULL, 1001, 1001, 1001, 1067246875800000001, 1706498194513, 1067246875800000001, 1721286641970, 't', '时间', 't', 't', ''); +INSERT INTO "public"."iot_section_detail" VALUES (1739102612969492482, 'custom-iframe-node', '网页', 1, '', 'svg', '{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID    ","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:9672575193ac","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"input-text","label":"链接地址","name":"linkAddress","id":"u:a447b3de3e1f","mode":"horizontal"},{"type":"switch","label":"禁止点击","option":"","name":"disableClick","falseValue":false,"trueValue":true,"id":"u:dd96c427c877","value":false,"mode":"horizontal"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"fieldset","title":"Iframe 内部脚本","collapsable":true,"body":[{"type":"combo","label":"iframe 内置插件","name":"iframePlugins","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ea5723f0c48c"},"items":[{"type":"input-text","name":"input-text","placeholder":"文本","id":"u:a3d8d02396c2"}],"id":"u:9beaf42b315d","strictMode":true,"syncFields":[]},{"type":"tpl","tpl":"脚本","inline":true,"wrapperComponent":"h3","id":"u:f899a9ccfb53"},{"type":"editor","label":"","name":"iframeScript","id":"u:844ba1d4c384","language":"javascript","inputClassName":"text-left","className":"my-0","description":"可以在脚本里面创建iframe 外链的 js 脚本代码,或动态创建任何信息,包含html. css, svg, 3d canvas 等。如果需要与外部交互,可以通过 window?.parent.postMessage(''任何数据信息xxx'', ''*'');"}],"id":"u:c1bd7dfd2a51","className":"m-b","bodyClassName":"text-left"},{"type":"fieldset","title":"Iframe 外部脚本","collapsable":true,"body":[{"type":"tpl","tpl":"function (context, iframeData ) {","inline":true,"wrapperComponent":"","id":"u:112d81401e0d"},{"type":"editor","label":"","name":"iframeOuterScript","id":"u:4db340521e32","language":"javascript","inputClassName":"text-left","className":"my-0","description":"内部脚本发送的数据默认会触发事件的改变,外部脚本可以不用填,作为备选的与外部交互的方式之一。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:b1f472522670"}],"id":"u:b7894335f3a4","className":"m-b","bodyClassName":"text-left"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"},{"type":"collapse","key":"2","header":"事件","body":[{"type":"service","id":"u:4ec2acc50405","body":[{"type":"combo","label":"","name":"eventCombo","multiple":true,"addable":false,"removable":false,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:ae1b0a0c0f55"},"items":[{"type":"select","name":"eventType","placeholder":"选择事件","options":[{"label":"改变","value":"change"}],"id":"u:a7b44847011a","label":"名称","multiple":false,"value":"change"},{"type":"checkBox","id":"u:79dadbc61f74","name":"enable","label":"启用"},{"type":"fieldset","title":"目标节点发起请求","collapsable":true,"body":[{"type":"input-text","label":"目标节点","name":"targetNode","id":"u:6efb6f120e47","multiple":false,"mode":"horizontal","inputClassName":"w-full","visibleOn":"this.eventType === ''change''","removable":"true","placeholder":"目标节点id"},{"type":"select","label":"入参类型","name":"targetParamsType","options":[{"label":"物实体","value":"entitys"},{"label":"物属性","value":"attrs"},{"label":"时间","value":"times"}],"id":"u:d10a57a9b966","multiple":false,"mode":"horizontal","inputClassName":"w-full","removable":true},{"type":"radios","label":"入参实体","name":"targetParamsEntitys","options":[{"label":"物组","value":"group"},{"label":"列表","value":"list"},{"label":"关系","value":"relation"},{"label":"搜索","value":"search"},{"label":"标签","value":"tag"},{"label":"类型","value":"type"}],"id":"u:26df91ece010","onEvent":{"change":{"actions":[{"actionType":"custom","script":"console.log(''event'', event);"}]}},"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''entitys''"},{"type":"radios","label":"属性类型","name":"targetParamsAttrsType","options":[{"label":"分属性","value":"split"},{"label":"全部","value":"all"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参属性","name":"targetParamsAttrsKeysEntitys","options":[{"label":"物","value":"entitys"},{"label":"属性","value":"keys"}],"id":"u:26df91ece010","checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''attrs''"},{"type":"radios","label":"入参时间","name":"targetParamsTimesType","options":[{"label":"最近","value":"nearest"},{"label":"时间段","value":"range"},{"label":"区间","value":"interval"}],"id":"u:26df91ece010","multiple":false,"checkAll":false,"joinValues":true,"inputClassName":"w-full text-left","mode":"horizontal","labelClassName":"","visibleOn":"this.targetParamsType === ''times''"},{"type":"input-text","label":"超级api","name":"apiId","id":"u:912394455375","placeholder":"超级apiId"}],"id":"u:fbccd2ccc8a3"},{"type":"fieldset","title":"更多操作","collapsable":true,"body":[{"type":"tpl","tpl":"function (context, service, nodeId, event) {","inline":true,"wrapperComponent":"","id":"u:799cd3277731"},{"type":"editor","id":"u:77aca39f5961","label":"","name":"moreOperation","language":"javascript","className":"my-0"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:cd392cfb6ffb"}],"id":"u:51249df94c65","bodyClassName":"text-left"}],"id":"u:364496dd313b","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:6d4a75088bc2","className":"border-none"},"strictMode":true,"syncFields":[],"labelClassName":""}],"data":{"eventCombo":[{"eventType":"change","enable":false,"config":""}]},"name":"eventsService"}],"id":"u:14834e895716","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \n2. service 是 Ajax 请求服务。\n3. nodeId 是节点 id . \n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}', '[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]', '{ + "nodes": [ + { + "id": "28c1cc50-eecd-4534-afef-bd752f52aaa2", + "type": "custom-iframe-node", + "x": 200, + "y": 200, + "text": { + "value": "", + "x": 200, + "y": 200 + }, + "properties": { + "id": "28c1cc50-eecd-4534-afef-bd752f52aaa2", + "width": 500, + "height": 300, + "x": 200, + "y": 200, + "rotation": 0, + "opacity": 1, + "disableClick": false, + "nodeAlias": "外链", + "showDefaultValue": false, + "showUnit": false, + "valueColor": "rgba(245, 166, 35, 1)", + "fontSize": 12, + "linkAddress": "", + "dynamic": { + "normalData": { + "dataPoint": "", + "compareType": "", + "conditionVariables": [], + "defaultValue": "", + "unit": "", + "iframeScript": "", + "iframeOuterScript": "", + "iframePlugins": [ + { + "input-text": "./plugins/vue.min.js" + }, + { + "input-text": "./plugins/axios.min.js" + }, + { + "input-text": "./plugins/lodash.js" + }, + { + "input-text": "./plugins/dayjs.min.js" + }, + { + "input-text": "./plugins/service.js" + }, + { + "input-text": "./iconfonts/iconfont.css" + }, + { + "input-text": "./plugins/layui/css/layui.css" + }, + { + "input-text": "./plugins/layui/layui.js" + } + ] + }, + "eventsData": { + "eventCombo": [ + { + "eventType": "change", + "enable": false, + "config": "" + } + ] + } + } + } + } + ] +}', '', 'const { createApp, createVNode, render } = Vue; +const app = createApp({}) + +const timeArr = new Array(24).fill(''''); +const totals = []; +timeArr.forEach((i, index) => { const t = window.dayjs().hour(index).valueOf(); totals.push({ val: Math.random(1000) * 100, ts: t, attrKey: "A29" }) }); +const defaultSocketValue = [] + +const generateHTML = (innerPage, plugins, iframeScript) => { + return ` + + + + ${innerPage} +