{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\decoration1\\src\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\decoration1\\src\\main.vue","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport autoResize from '../../../mixin/autoResize'\n\nimport { deepMerge } from '@jiaminghi/charts/lib/util/index'\n\nimport { deepClone } from '@jiaminghi/c-render/lib/plugin/util'\n\nexport default {\n name: 'DvDecoration1',\n mixins: [autoResize],\n props: {\n color: {\n type: Array,\n default: () => ([])\n }\n },\n data () {\n const pointSideLength = 2.5\n\n return {\n ref: 'decoration-1',\n\n svgWH: [200, 50],\n\n svgScale: [1, 1],\n\n rowNum: 4,\n rowPoints: 20,\n\n pointSideLength,\n halfPointSideLength: pointSideLength / 2,\n\n points: [],\n\n rects: [],\n\n defaultColor: ['#fff', '#0de7c2'],\n\n mergedColor: []\n }\n },\n watch: {\n color () {\n const { mergeColor } = this\n\n mergeColor()\n }\n },\n methods: {\n afterAutoResizeMixinInit () {\n const { calcSVGData } = this\n\n calcSVGData()\n },\n calcSVGData () {\n const { calcPointsPosition, calcRectsPosition, calcScale } = this\n\n calcPointsPosition()\n\n calcRectsPosition()\n\n calcScale()\n },\n calcPointsPosition () {\n const { svgWH, rowNum, rowPoints } = this\n\n const [w, h] = svgWH\n\n const horizontalGap = w / (rowPoints + 1)\n const verticalGap = h / (rowNum + 1)\n\n let points = new Array(rowNum).fill(0).map((foo, i) =>\n new Array(rowPoints).fill(0).map((foo, j) => [\n horizontalGap * (j + 1), verticalGap * (i + 1)\n ]))\n\n this.points = points.reduce((all, item) => [...all, ...item], [])\n },\n calcRectsPosition () {\n const { points, rowPoints } = this\n\n const rect1 = points[rowPoints * 2 - 1]\n const rect2 = points[rowPoints * 2 - 3]\n\n this.rects = [rect1, rect2]\n },\n calcScale () {\n const { width, height, svgWH } = this\n\n const [w, h] = svgWH\n\n this.svgScale = [width / w, height / h]\n },\n onResize () {\n const { calcSVGData } = this\n\n calcSVGData()\n },\n mergeColor () {\n const { color, defaultColor } = this\n\n this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])\n }\n },\n mounted () {\n const { mergeColor } = this\n\n mergeColor()\n }\n}\n",null]}