UNPKG

wetrade-design

Version:

一款多语言支持Vue3的UI框架

213 lines (184 loc) 7.77 kB
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; import _extends from "@babel/runtime/helpers/esm/extends"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import { uuid } from './index'; /** * 额外数据模型 在link中meta只作为前端使用、在node中meta内容中除extParam外都是对服务端有意义的 */ export var Meta = /*#__PURE__*/_createClass( // 大小于(工具的符号) // 配置key // 配置key的名称 // 条件父类型(个股条件/大盘条件) // 扩展字段 // 配置标识(后端用) // 反弹回撤价差(买卖节点用) // 市场(主模型开始节点) // 股票范围(主模型开始节点) // 节点值(条件、工具的值) // 选中的买卖点(起始节点用)- Array // 前置节点(买入卖出节点用)- Array - 废弃 // 选择的买入卖出类型: 1: 买入卖出 2:子模型(买卖节点用) // 选择的买入卖出方式: 1-涨势/跌势交易;2-反弹/回撤交易 // 子节点(塞的是子节点) // 节点类型(条件分类/条件/工具) // 后续订单是否需要校验行情 0-不需要 1-需要 // 生成卖出/买入指令前 1-校验 0-不校验 买入/卖出放单 // 生成卖出/买入指令前放单有效期 // 是否需要校验卖出路径的条件 0表示不检查,1表示检查 // 立即卖出的盈亏比例 // 利润回撤比例配置 // 最小获利比例选项 0-盈利比例 1-个股振幅 function Meta(_ref) { var _ref$compare = _ref.compare, compare = _ref$compare === void 0 ? null : _ref$compare, _ref$configKey = _ref.configKey, configKey = _ref$configKey === void 0 ? null : _ref$configKey, _ref$configName = _ref.configName, configName = _ref$configName === void 0 ? null : _ref$configName, _ref$configType = _ref.configType, configType = _ref$configType === void 0 ? null : _ref$configType, _ref$extParam = _ref.extParam, extParam = _ref$extParam === void 0 ? null : _ref$extParam, _ref$processorPrefix = _ref.processorPrefix, processorPrefix = _ref$processorPrefix === void 0 ? null : _ref$processorPrefix, _ref$reboundRetreatPr = _ref.reboundRetreatPriceDiff, reboundRetreatPriceDiff = _ref$reboundRetreatPr === void 0 ? null : _ref$reboundRetreatPr, _ref$regionType = _ref.regionType, regionType = _ref$regionType === void 0 ? null : _ref$regionType, _ref$stockRange = _ref.stockRange, stockRange = _ref$stockRange === void 0 ? null : _ref$stockRange, _ref$type = _ref.type, type = _ref$type === void 0 ? null : _ref$type, _ref$values = _ref.values, values = _ref$values === void 0 ? null : _ref$values, _ref$strategyPoints = _ref.strategyPoints, strategyPoints = _ref$strategyPoints === void 0 ? [] : _ref$strategyPoints, _ref$buyAndSellType = _ref.buyAndSellType, buyAndSellType = _ref$buyAndSellType === void 0 ? null : _ref$buyAndSellType, _ref$tradeType = _ref.tradeType, tradeType = _ref$tradeType === void 0 ? null : _ref$tradeType, _ref$preNode = _ref.preNode, preNode = _ref$preNode === void 0 ? [] : _ref$preNode, _ref$children = _ref.children, children = _ref$children === void 0 ? [] : _ref$children, _ref$needCheckBeforeR = _ref.needCheckBeforeReleaseOrder, needCheckBeforeReleaseOrder = _ref$needCheckBeforeR === void 0 ? null : _ref$needCheckBeforeR, _ref$needCheckBeforeR2 = _ref.needCheckBeforeReleaseCmd, needCheckBeforeReleaseCmd = _ref$needCheckBeforeR2 === void 0 ? null : _ref$needCheckBeforeR2, _ref$needCheckBeforeR3 = _ref.needCheckBeforeReleaseCmdExpireDay, needCheckBeforeReleaseCmdExpireDay = _ref$needCheckBeforeR3 === void 0 ? null : _ref$needCheckBeforeR3, _ref$needCheckSelfLin = _ref.needCheckSelfLinkBeforeReleaseCmd, needCheckSelfLinkBeforeReleaseCmd = _ref$needCheckSelfLin === void 0 ? null : _ref$needCheckSelfLin, _ref$executeSellingPr = _ref.executeSellingProfitRate, executeSellingProfitRate = _ref$executeSellingPr === void 0 ? null : _ref$executeSellingPr, _ref$ratioConfig = _ref.ratioConfig, ratioConfig = _ref$ratioConfig === void 0 ? null : _ref$ratioConfig, _ref$floatingRatioTyp = _ref.floatingRatioType, floatingRatioType = _ref$floatingRatioTyp === void 0 ? null : _ref$floatingRatioTyp; _classCallCheck(this, Meta); this.compare = compare; this.configKey = configKey; this.configName = configName; this.configType = configType; this.extParam = _extends({ // 展示增加按钮(合并节点的父节点不展示-属性处理里处理) canInsert: true, // 工具和条件是否有强关系 1.3.132迭代去除了强关联不展示【+】的逻辑 // toolAndConditionHasStrongRel: false, // 是否高亮 isHighLight: false, // 是否为合并的特殊节点 isMergeNode: false, // 是否展开 isOpen: true, // 工具配置信息 (投管业务在用) configParams: null, // 是否在拖拽中 isDragging: false, // 工具是否校验通过 verifyStatus: false, // 工具是否是编辑态 toolsIsEdit: false, // 收起数量 shrinkNum: 0, // 是否为拖拽占位元素 isDragElement: false, // 是否在合并链路上 inMerge: false, // 收起节点是否禁用 shrinkDisabled: false }, extParam); this.processorPrefix = processorPrefix; this.reboundRetreatPriceDiff = reboundRetreatPriceDiff; this.regionType = regionType; this.stockRange = stockRange; this.type = type; this.values = values; this.strategyPoints = strategyPoints; this.buyAndSellType = buyAndSellType; this.tradeType = tradeType; this.preNode = preNode; this.children = children; this.type = type; this.needCheckBeforeReleaseOrder = needCheckBeforeReleaseOrder; this.needCheckBeforeReleaseCmd = needCheckBeforeReleaseCmd; this.needCheckBeforeReleaseCmdExpireDay = needCheckBeforeReleaseCmdExpireDay; this.needCheckSelfLinkBeforeReleaseCmd = needCheckSelfLinkBeforeReleaseCmd; this.executeSellingProfitRate = executeSellingProfitRate; this.ratioConfig = ratioConfig; this.floatingRatioType = floatingRatioType; }); /** * 节点数据结构 */ export var Node = /*#__PURE__*/_createClass( // 宽度 // 高度 // 坐标 // meta function Node(_ref2) { var _ref2$width = _ref2.width, width = _ref2$width === void 0 ? 240 : _ref2$width, _ref2$height = _ref2.height, height = _ref2$height === void 0 ? 68 : _ref2$height, _ref2$coordinate = _ref2.coordinate, coordinate = _ref2$coordinate === void 0 ? [0, 0] : _ref2$coordinate, _ref2$meta = _ref2.meta, meta = _ref2$meta === void 0 ? new Meta({}) : _ref2$meta; _classCallCheck(this, Node); _defineProperty(this, "id", uuid()); this.width = width; this.height = height; this.coordinate = coordinate; this.meta = new Meta(meta); }); /** * 连线数据结构 */ export var Link = /*#__PURE__*/_createClass( // 画线用 // 画线用 function Link(_ref3) { var startId = _ref3.startId, endId = _ref3.endId, _ref3$startAt = _ref3.startAt, startAt = _ref3$startAt === void 0 ? [240, 50] : _ref3$startAt, _ref3$endAt = _ref3.endAt, endAt = _ref3$endAt === void 0 ? [0, 50] : _ref3$endAt, _ref3$meta = _ref3.meta, meta = _ref3$meta === void 0 ? null : _ref3$meta; _classCallCheck(this, Link); _defineProperty(this, "id", uuid()); this.startId = startId; this.endId = endId; this.startAt = startAt; this.endAt = endAt; this.meta = _extends({ // 合并线路点击同时高亮标记id 默认为-1 activeId: -1, // 是否高亮 默认为false isHighLight: false }, meta); });