acdr-ui/dist/dev/mp-weixin/uni_modules/lime-painter/components/l-painter/l-painter.js.map

1 line
24 KiB
Plaintext

{"version":3,"file":"l-painter.js","sources":["../../../../../../../src/uni_modules/lime-painter/components/l-painter/l-painter.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy91bmlfbW9kdWxlcy9saW1lLXBhaW50ZXIvY29tcG9uZW50cy9sLXBhaW50ZXIvbC1wYWludGVyLnZ1ZQ"],"sourcesContent":["<template>\r\n <view class=\"lime-painter\" ref=\"limepainter\">\r\n <view v-if=\"canvasId && size\" :style=\"styles\">\r\n <!-- #ifndef APP-NVUE -->\r\n <canvas\r\n class=\"lime-painter__canvas\"\r\n v-if=\"use2dCanvas\"\r\n :id=\"canvasId\"\r\n type=\"2d\"\r\n :style=\"size\"\r\n ></canvas>\r\n <canvas\r\n class=\"lime-painter__canvas\"\r\n v-else\r\n :id=\"canvasId\"\r\n :canvas-id=\"canvasId\"\r\n :style=\"size\"\r\n :width=\"boardWidth * dpr\"\r\n :height=\"boardHeight * dpr\"\r\n :hidpi=\"hidpi\"\r\n ></canvas>\r\n\r\n <!-- #endif -->\r\n <!-- #ifdef APP-NVUE -->\r\n <web-view\r\n :style=\"size\"\r\n ref=\"webview\"\r\n src=\"/uni_modules/lime-painter/hybrid/html/index.html\"\r\n class=\"lime-painter__canvas\"\r\n @pagefinish=\"onPageFinish\"\r\n @error=\"onError\"\r\n @onPostMessage=\"onMessage\"\r\n ></web-view>\r\n <!-- #endif -->\r\n </view>\r\n <slot />\r\n </view>\r\n</template>\r\n\r\n<script>\r\nimport { parent } from '../common/relation'\r\nimport props from './props'\r\nimport { toPx, base64ToPath, pathToBase64, isBase64, sleep, getImageInfo } from './utils'\r\n// #ifndef APP-NVUE\r\nimport { canIUseCanvas2d, isPC } from './utils'\r\nimport Painter from './painter'\r\n// import Painter from '@painter'\r\nconst nvue = {}\r\n// #endif\r\n// #ifdef APP-NVUE\r\nimport nvue from './nvue'\r\n// #endif\r\nexport default {\r\n name: 'lime-painter',\r\n mixins: [props, parent('painter'), nvue],\r\n data() {\r\n return {\r\n use2dCanvas: false,\r\n canvasHeight: 150,\r\n canvasWidth: null,\r\n parentWidth: 0,\r\n inited: false,\r\n progress: 0,\r\n firstRender: 0,\r\n done: false,\r\n tasks: [],\r\n }\r\n },\r\n computed: {\r\n styles() {\r\n return (\r\n `${this.size}${this.customStyle || ''};` +\r\n (this.hidden && 'position: fixed; left: 1500rpx;')\r\n )\r\n },\r\n canvasId() {\r\n return `l-painter${(this._ && this._.uid) || this._uid}`\r\n },\r\n size() {\r\n if (this.boardWidth && this.boardHeight) {\r\n return `width:${this.boardWidth}px; height: ${this.boardHeight}px;`\r\n }\r\n },\r\n dpr() {\r\n return this.pixelRatio || uni.getSystemInfoSync().pixelRatio\r\n },\r\n boardWidth() {\r\n const { width = 0 } = (this.elements && this.elements.css) || this.elements || this\r\n const w = toPx(width || this.width)\r\n return w || Math.max(w, toPx(this.canvasWidth))\r\n },\r\n boardHeight() {\r\n const { height = 0 } = (this.elements && this.elements.css) || this.elements || this\r\n const h = toPx(height || this.height)\r\n return h || Math.max(h, toPx(this.canvasHeight))\r\n },\r\n hasBoard() {\r\n return this.board && Object.keys(this.board).length\r\n },\r\n elements() {\r\n return this.hasBoard ? this.board : JSON.parse(JSON.stringify(this.el))\r\n },\r\n },\r\n created() {\r\n this.use2dCanvas = this.type === '2d' && canIUseCanvas2d() && !isPC\r\n },\r\n async mounted() {\r\n await sleep(30)\r\n await this.getParentWeith()\r\n this.$nextTick(() => {\r\n setTimeout(() => {\r\n this.$watch('elements', this.watchRender, {\r\n deep: true,\r\n immediate: true,\r\n })\r\n }, 30)\r\n })\r\n },\r\n // #ifdef VUE3\r\n unmounted() {\r\n this.done = false\r\n this.inited = false\r\n this.firstRender = 0\r\n this.progress = 0\r\n this.painter = null\r\n clearTimeout(this.rendertimer)\r\n },\r\n // #endif\r\n // #ifdef VUE2\r\n destroyed() {\r\n this.done = false\r\n this.inited = false\r\n this.firstRender = 0\r\n this.progress = 0\r\n this.painter = null\r\n clearTimeout(this.rendertimer)\r\n },\r\n // #endif\r\n methods: {\r\n async watchRender(val, old) {\r\n if (\r\n !val ||\r\n !val.views ||\r\n (!this.firstRender ? !val.views.length : !this.firstRender) ||\r\n !Object.keys(val).length ||\r\n JSON.stringify(val) == JSON.stringify(old)\r\n )\r\n return\r\n this.firstRender = 1\r\n this.progress = 0\r\n this.done = false\r\n clearTimeout(this.rendertimer)\r\n this.rendertimer = setTimeout(() => {\r\n this.render(val)\r\n }, this.beforeDelay)\r\n },\r\n async setFilePath(path, param) {\r\n let filePath = path\r\n const { pathType = this.pathType } = param || this\r\n if (pathType == 'base64' && !isBase64(path)) {\r\n filePath = await pathToBase64(path)\r\n } else if (pathType == 'url' && isBase64(path)) {\r\n filePath = await base64ToPath(path)\r\n }\r\n if (param && param.isEmit) {\r\n this.$emit('success', filePath)\r\n }\r\n return filePath\r\n },\r\n async getSize(args) {\r\n const { width } = args.css || args\r\n const { height } = args.css || args\r\n if (!this.size) {\r\n if (width || height) {\r\n this.canvasWidth = width || this.canvasWidth\r\n this.canvasHeight = height || this.canvasHeight\r\n await sleep(30)\r\n } else {\r\n await this.getParentWeith()\r\n }\r\n }\r\n },\r\n canvasToTempFilePathSync(args) {\r\n // this.stopWatch && this.stopWatch()\r\n // this.stopWatch = this.$watch('done', (v) => {\r\n // \tif (v) {\r\n // \t\tthis.canvasToTempFilePath(args)\r\n // \t\tthis.stopWatch && this.stopWatch()\r\n // \t}\r\n // }, {\r\n // \timmediate: true\r\n // })\r\n this.tasks.push(args)\r\n if (this.done) {\r\n this.runTask()\r\n }\r\n },\r\n runTask() {\r\n while (this.tasks.length) {\r\n const task = this.tasks.shift()\r\n this.canvasToTempFilePath(task)\r\n }\r\n },\r\n // #ifndef APP-NVUE\r\n getParentWeith() {\r\n return new Promise((resolve) => {\r\n uni\r\n .createSelectorQuery()\r\n .in(this)\r\n .select(`.lime-painter`)\r\n .boundingClientRect()\r\n .exec((res) => {\r\n const { width, height } = res[0] || {}\r\n this.parentWidth = Math.ceil(width || 0)\r\n this.canvasWidth = this.parentWidth || 300\r\n this.canvasHeight = height || this.canvasHeight || 150\r\n resolve(res[0])\r\n })\r\n })\r\n },\r\n async render(args = {}) {\r\n if (!Object.keys(args).length) {\r\n return console.error('空对象')\r\n }\r\n this.progress = 0\r\n this.done = false\r\n // #ifdef APP-NVUE\r\n this.tempFilePath.length = 0\r\n // #endif\r\n await this.getSize(args)\r\n const ctx = await this.getContext()\r\n\r\n let { use2dCanvas, boardWidth, boardHeight, canvas, afterDelay } = this\r\n if (use2dCanvas && !canvas) {\r\n return Promise.reject(new Error('canvas 没创建'))\r\n }\r\n this.boundary = {\r\n top: 0,\r\n left: 0,\r\n width: boardWidth,\r\n height: boardHeight,\r\n }\r\n this.painter = null\r\n if (!this.painter) {\r\n const { width } = args.css || args\r\n const { height } = args.css || args\r\n if (!width && this.parentWidth) {\r\n Object.assign(args, { width: this.parentWidth })\r\n }\r\n const param = {\r\n context: ctx,\r\n canvas,\r\n width: boardWidth,\r\n height: boardHeight,\r\n pixelRatio: this.dpr,\r\n useCORS: this.useCORS,\r\n createImage: getImageInfo.bind(this),\r\n performance: this.performance,\r\n listen: {\r\n onProgress: (v) => {\r\n this.progress = v\r\n this.$emit('progress', v)\r\n },\r\n onEffectFail: (err) => {\r\n this.$emit('faill', err)\r\n },\r\n },\r\n }\r\n this.painter = new Painter(param)\r\n }\r\n try {\r\n // vue3 赋值给data会引起图片无法绘制\r\n const { width, height } = await this.painter.source(JSON.parse(JSON.stringify(args)))\r\n this.boundary.height = this.canvasHeight = height\r\n this.boundary.width = this.canvasWidth = width\r\n await sleep(this.sleep)\r\n await this.painter.render()\r\n await new Promise((resolve) => this.$nextTick(resolve))\r\n if (!use2dCanvas) {\r\n await this.canvasDraw()\r\n }\r\n if (afterDelay && use2dCanvas) {\r\n await sleep(afterDelay)\r\n }\r\n this.$emit('done')\r\n this.done = true\r\n if (this.isCanvasToTempFilePath) {\r\n this.canvasToTempFilePath()\r\n .then((res) => {\r\n this.$emit('success', res.tempFilePath)\r\n })\r\n .catch((err) => {\r\n this.$emit('fail', new Error(JSON.stringify(err)))\r\n })\r\n }\r\n this.runTask()\r\n return Promise.resolve({\r\n ctx,\r\n draw: this.painter,\r\n node: this.node,\r\n })\r\n } catch (e) {\r\n //TODO handle the exception\r\n }\r\n },\r\n canvasDraw(flag = false) {\r\n return new Promise((resolve, reject) =>\r\n this.ctx.draw(flag, () => setTimeout(() => resolve(), this.afterDelay)),\r\n )\r\n },\r\n async getContext() {\r\n if (!this.canvasWidth) {\r\n this.$emit('fail', 'painter no size')\r\n console.error('[lime-painter]: 给画板或父级设置尺寸')\r\n return Promise.reject()\r\n }\r\n if (this.ctx && this.inited) {\r\n return Promise.resolve(this.ctx)\r\n }\r\n const { type, use2dCanvas, dpr, boardWidth, boardHeight } = this\r\n const _getContext = () => {\r\n return new Promise((resolve) => {\r\n uni\r\n .createSelectorQuery()\r\n .in(this)\r\n .select(`#${this.canvasId}`)\r\n .boundingClientRect()\r\n .exec((res) => {\r\n if (res) {\r\n const ctx = uni.createCanvasContext(this.canvasId, this)\r\n if (!this.inited) {\r\n this.inited = true\r\n this.use2dCanvas = false\r\n this.canvas = res\r\n }\r\n\r\n // 钉钉小程序框架不支持 measureText 方法,用此方法 mock\r\n if (!ctx.measureText) {\r\n function strLen(str) {\r\n let len = 0\r\n for (let i = 0; i < str.length; i++) {\r\n if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {\r\n len++\r\n } else {\r\n len += 2\r\n }\r\n }\r\n return len\r\n }\r\n ctx.measureText = (text) => {\r\n let fontSize = (ctx.state && ctx.state.fontSize) || 12\r\n const font = ctx.__font\r\n if (font && fontSize == 12) {\r\n fontSize = parseInt(font.split(' ')[3], 10)\r\n }\r\n fontSize /= 2\r\n return {\r\n width: strLen(text) * fontSize,\r\n }\r\n }\r\n }\r\n\r\n // #ifdef MP-ALIPAY\r\n ctx.scale(dpr, dpr)\r\n // #endif\r\n this.ctx = ctx\r\n resolve(this.ctx)\r\n } else {\r\n console.error('[lime-painter] no node')\r\n }\r\n })\r\n })\r\n }\r\n if (!use2dCanvas) {\r\n return _getContext()\r\n }\r\n return new Promise((resolve) => {\r\n uni\r\n .createSelectorQuery()\r\n .in(this)\r\n .select(`#${this.canvasId}`)\r\n .node()\r\n .exec((res) => {\r\n let { node: canvas } = (res && res[0]) || {}\r\n if (canvas) {\r\n const ctx = canvas.getContext(type)\r\n if (!this.inited) {\r\n this.inited = true\r\n this.use2dCanvas = true\r\n this.canvas = canvas\r\n }\r\n this.ctx = ctx\r\n resolve(this.ctx)\r\n } else {\r\n console.error('[lime-painter]: no size')\r\n }\r\n })\r\n })\r\n },\r\n canvasToTempFilePath(args = {}) {\r\n return new Promise(async (resolve, reject) => {\r\n const { use2dCanvas, canvasId, dpr, fileType, quality } = this\r\n const success = async (res) => {\r\n try {\r\n const tempFilePath = await this.setFilePath(res.tempFilePath || res, args)\r\n const result = Object.assign(res, { tempFilePath })\r\n args.success && args.success(result)\r\n resolve(result)\r\n } catch (e) {\r\n this.$emit('fail', e)\r\n }\r\n }\r\n\r\n let { top: y = 0, left: x = 0, width, height } = this.boundary || this\r\n // let destWidth = width * dpr;\r\n // let destHeight = height * dpr;\r\n // #ifdef MP-ALIPAY\r\n // width = destWidth;\r\n // height = destHeight;\r\n // #endif\r\n\r\n const copyArgs = Object.assign(\r\n {\r\n // x,\r\n // y,\r\n // width,\r\n // height,\r\n // destWidth,\r\n // destHeight,\r\n canvasId,\r\n id: canvasId,\r\n fileType,\r\n quality,\r\n },\r\n args,\r\n { success },\r\n )\r\n // if(this.isPC || use2dCanvas) {\r\n // \tcopyArgs.canvas = this.canvas\r\n // }\r\n if (use2dCanvas) {\r\n copyArgs.canvas = this.canvas\r\n try {\r\n // #ifndef MP-ALIPAY\r\n const oFilePath = this.canvas.toDataURL(\r\n `image/${args.fileType || fileType}`.replace(/pg/, 'peg'),\r\n args.quality || quality,\r\n )\r\n if (/data:,/.test(oFilePath)) {\r\n uni.canvasToTempFilePath(copyArgs, this)\r\n } else {\r\n const tempFilePath = await this.setFilePath(oFilePath, args)\r\n args.success && args.success({ tempFilePath })\r\n resolve({ tempFilePath })\r\n }\r\n // #endif\r\n // #ifdef MP-ALIPAY\r\n this.canvas.toTempFilePath(copyArgs)\r\n // #endif\r\n } catch (e) {\r\n args.fail && args.fail(e)\r\n reject(e)\r\n }\r\n } else {\r\n // #ifdef MP-ALIPAY\r\n if (this.ctx.toTempFilePath) {\r\n // 钉钉\r\n const ctx = uni.createCanvasContext(canvasId)\r\n ctx.toTempFilePath(copyArgs)\r\n } else {\r\n my.canvasToTempFilePath(copyArgs)\r\n }\r\n // #endif\r\n // #ifndef MP-ALIPAY\r\n uni.canvasToTempFilePath(copyArgs, this)\r\n // #endif\r\n }\r\n })\r\n },\r\n // #endif\r\n },\r\n}\r\n</script>\r\n<style>\r\n.lime-painter,\r\n.lime-painter__canvas {\r\n\t// #ifndef APP-NVUE\r\n\twidth: 100%;\r\n\t// #endif\r\n\t// #ifdef APP-NVUE\r\n\tflex: 1;\r\n\t// #endif\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/uni_modules/lime-painter/components/l-painter/l-painter.vue'\nwx.createComponent(Component)"],"names":["props","parent","uni","toPx","canIUseCanvas2d","isPC","sleep","isBase64","pathToBase64","base64ToPath","getImageInfo","Painter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,OAAO,CAAC;AAKd,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EACN,QAAQ,CAACA,kDAAK,OAAEC,mDAAM,OAAC,SAAS,GAAG,IAAI;AAAA,EACvC,OAAO;AACL,WAAO;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,aAAa;AAAA,MACb,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MAC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