{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\node_modules\\@jiaminghi\\data-view\\lib\\components\\digitalFlop\\src\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\@jiaminghi\\data-view\\lib\\components\\digitalFlop\\src\\main.vue","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _slicedToArray from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\n//\n//\n//\n//\n//\n//\n\nimport CRender from '@jiaminghi/c-render';\nimport '@jiaminghi/charts/lib/extend/index';\nimport { deepMerge } from '@jiaminghi/charts/lib/util/index';\nimport { deepClone } from '@jiaminghi/c-render/lib/plugin/util';\nexport default {\n  name: 'DvDigitalFlop',\n  props: {\n    config: {\n      type: Object,\n      default: function _default() {\n        return {};\n      }\n    }\n  },\n  data: function data() {\n    return {\n      renderer: null,\n      defaultConfig: {\n        /**\n         * @description Number for digital flop\n         * @type {Array<Number>}\n         * @default number = []\n         * @example number = [10]\n         */\n        number: [],\n        /**\n         * @description Content formatter\n         * @type {String}\n         * @default content = ''\n         * @example content = '{nt}个'\n         */\n        content: '',\n        /**\n         * @description Number toFixed\n         * @type {Number}\n         * @default toFixed = 0\n         */\n        toFixed: 0,\n        /**\n         * @description Text align\n         * @type {String}\n         * @default textAlign = 'center'\n         * @example textAlign = 'center' | 'left' | 'right'\n         */\n        textAlign: 'center',\n        /**\n         * @description rowGap\n         * @type {Number}\n         @default rowGap = 0\n         */\n        rowGap: 0,\n        /**\n         * @description Text style configuration\n         * @type {Object} {CRender Class Style}\n         */\n        style: {\n          fontSize: 30,\n          fill: '#3de7c9'\n        },\n        /**\n         * @description Number formatter\n         * @type {Null|Function}\n         */\n        formatter: undefined,\n        /**\n         * @description CRender animationCurve\n         * @type {String}\n         * @default animationCurve = 'easeOutCubic'\n         */\n        animationCurve: 'easeOutCubic',\n        /**\n         * @description CRender animationFrame\n         * @type {String}\n         * @default animationFrame = 50\n         */\n        animationFrame: 50\n      },\n      mergedConfig: null,\n      graph: null\n    };\n  },\n  watch: {\n    config: function config() {\n      var update = this.update;\n      update();\n    }\n  },\n  methods: {\n    init: function init() {\n      var initRender = this.initRender,\n        mergeConfig = this.mergeConfig,\n        initGraph = this.initGraph;\n      initRender();\n      mergeConfig();\n      initGraph();\n    },\n    initRender: function initRender() {\n      var $refs = this.$refs;\n      this.renderer = new CRender($refs['digital-flop']);\n    },\n    mergeConfig: function mergeConfig() {\n      var defaultConfig = this.defaultConfig,\n        config = this.config;\n      this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {});\n    },\n    initGraph: function initGraph() {\n      var getShape = this.getShape,\n        getStyle = this.getStyle,\n        renderer = this.renderer,\n        mergedConfig = this.mergedConfig;\n      var animationCurve = mergedConfig.animationCurve,\n        animationFrame = mergedConfig.animationFrame;\n      var shape = getShape();\n      var style = getStyle();\n      this.graph = renderer.add({\n        name: 'numberText',\n        animationCurve: animationCurve,\n        animationFrame: animationFrame,\n        shape: shape,\n        style: style\n      });\n    },\n    getShape: function getShape() {\n      var _this$mergedConfig = this.mergedConfig,\n        number = _this$mergedConfig.number,\n        content = _this$mergedConfig.content,\n        toFixed = _this$mergedConfig.toFixed,\n        textAlign = _this$mergedConfig.textAlign,\n        rowGap = _this$mergedConfig.rowGap,\n        formatter = _this$mergedConfig.formatter;\n      var _this$renderer$area = _slicedToArray(this.renderer.area, 2),\n        w = _this$renderer$area[0],\n        h = _this$renderer$area[1];\n      var position = [w / 2, h / 2];\n      if (textAlign === 'left') position[0] = 0;\n      if (textAlign === 'right') position[0] = w;\n      return {\n        number: number,\n        content: content,\n        toFixed: toFixed,\n        position: position,\n        rowGap: rowGap,\n        formatter: formatter\n      };\n    },\n    getStyle: function getStyle() {\n      var _this$mergedConfig2 = this.mergedConfig,\n        style = _this$mergedConfig2.style,\n        textAlign = _this$mergedConfig2.textAlign;\n      return deepMerge(style, {\n        textAlign: textAlign,\n        textBaseline: 'middle'\n      });\n    },\n    update: function update() {\n      var mergeConfig = this.mergeConfig,\n        mergeShape = this.mergeShape,\n        getShape = this.getShape,\n        getStyle = this.getStyle,\n        graph = this.graph,\n        mergedConfig = this.mergedConfig;\n      graph.animationEnd();\n      mergeConfig();\n      if (!graph) return;\n      var animationCurve = mergedConfig.animationCurve,\n        animationFrame = mergedConfig.animationFrame;\n      var shape = getShape();\n      var style = getStyle();\n      mergeShape(graph, shape);\n      graph.animationCurve = animationCurve;\n      graph.animationFrame = animationFrame;\n      graph.animation('style', style, true);\n      graph.animation('shape', shape);\n    },\n    mergeShape: function mergeShape(graph, shape) {\n      var cacheNum = graph.shape.number.length;\n      var shapeNum = shape.number.length;\n      if (cacheNum !== shapeNum) graph.shape.number = shape.number;\n    }\n  },\n  mounted: function mounted() {\n    var init = this.init;\n    init();\n  }\n};",null]}