build
This commit is contained in:
parent
1ab3aefaa5
commit
3112425e43
11
cmd
11
cmd
@ -60,6 +60,11 @@ check_docker() {
|
|||||||
echo -e "${Error} ${RedBG} 未安装 Docker-compose!${Font}"
|
echo -e "${Error} ${RedBG} 未安装 Docker-compose!${Font}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ -n `docker-compose --version | grep "docker-compose" | grep -E "\sv*1"` ]]; then
|
||||||
|
docker-compose --version
|
||||||
|
echo -e "${Error} ${RedBG} Docker-compose 版本过低,请升级至v2+!${Font}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_node() {
|
check_node() {
|
||||||
@ -263,8 +268,7 @@ if [ $# -gt 0 ]; then
|
|||||||
chmod -R 775 "${cur_path}/docker/mysql/data"
|
chmod -R 775 "${cur_path}/docker/mysql/data"
|
||||||
# 启动容器
|
# 启动容器
|
||||||
[[ "$(arg_get port)" -gt 0 ]] && env_set APP_PORT "$(arg_get port)"
|
[[ "$(arg_get port)" -gt 0 ]] && env_set APP_PORT "$(arg_get port)"
|
||||||
docker-compose up -d
|
docker-compose up php -d
|
||||||
docker-compose restart php
|
|
||||||
# 安装composer依赖
|
# 安装composer依赖
|
||||||
run_exec php "composer install"
|
run_exec php "composer install"
|
||||||
if [ ! -f "${cur_path}/vendor/autoload.php" ]; then
|
if [ ! -f "${cur_path}/vendor/autoload.php" ]; then
|
||||||
@ -292,8 +296,7 @@ if [ $# -gt 0 ]; then
|
|||||||
run_exec php "php artisan migrate --seed"
|
run_exec php "php artisan migrate --seed"
|
||||||
# 设置初始化密码
|
# 设置初始化密码
|
||||||
res=`run_exec mariadb "sh /etc/mysql/repassword.sh"`
|
res=`run_exec mariadb "sh /etc/mysql/repassword.sh"`
|
||||||
docker-compose stop
|
docker-compose up -d
|
||||||
docker-compose start
|
|
||||||
echo -e "${OK} ${GreenBG} 安装完成 ${Font}"
|
echo -e "${OK} ${GreenBG} 安装完成 ${Font}"
|
||||||
echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
|
echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
|
||||||
echo -e "$res"
|
echo -e "$res"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -111,17 +111,18 @@ services:
|
|||||||
|
|
||||||
drawio:
|
drawio:
|
||||||
container_name: "dootask-drawio-${APP_ID}"
|
container_name: "dootask-drawio-${APP_ID}"
|
||||||
image: "jgraph/drawio"
|
image: "jgraph/drawio:16.6.1"
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/drawio/index.html:/usr/local/tomcat/webapps/draw/index.html
|
- ./docker/drawio/index.html:/usr/local/tomcat/webapps/draw/index.html
|
||||||
- ./docker/drawio/js/app.min.js:/usr/local/tomcat/webapps/draw/js/app.min.js
|
- ./docker/drawio/js/app.min.js:/usr/local/tomcat/webapps/draw/js/app.min.js
|
||||||
networks:
|
networks:
|
||||||
extnetwork:
|
extnetwork:
|
||||||
ipv4_address: "${APP_IPPR}.8"
|
ipv4_address: "${APP_IPPR}.8"
|
||||||
|
environment:
|
||||||
|
TZ: "Asia/Shanghai"
|
||||||
|
EXPORT_URL: "http://drawio-export:8000/"
|
||||||
depends_on:
|
depends_on:
|
||||||
- drawio-export
|
- drawio-export
|
||||||
environment:
|
|
||||||
- EXPORT_URL=http://drawio-export:8000/
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
drawio-export:
|
drawio-export:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.9.7",
|
"version": "0.9.10",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.9.7",
|
"version": "0.9.10",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"start": "./cmd dev",
|
||||||
|
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
1
public/js/build/45.js
vendored
1
public/js/build/45.js
vendored
@ -1 +0,0 @@
|
|||||||
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[45],{80550:(t,e,n)=>{n.d(e,{Z:()=>r});var a=n(1519),o=n.n(a)()((function(t){return t[1]}));o.push([t.id,".drawio-content[data-v-29b5583c],.drawio-content .drawio-iframe[data-v-29b5583c]{height:100%;left:0;position:absolute;top:0;width:100%}.drawio-content .drawio-iframe[data-v-29b5583c]{background:0 0;border:0;float:none;margin:-1px 0 0;max-width:none;outline:0;padding:0}.drawio-content .drawio-loading[data-v-29b5583c]{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}",""]);const r=o},45045:(t,e,n)=>{n.r(e),n.d(e,{default:()=>u});var a=n(20629);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const i={name:"Drawio",props:{value:{type:Object,default:function(){return{}}},readOnly:{type:Boolean,default:!1}},data:function(){return{loadIng:!0,url:null,bakData:""}},created:function(){var t="en";switch(this.getLanguage()){case"CN":case"TC":t="zh"}var e=this.readOnly?0:1,n=this.readOnly?1:0,a=this.themeIsDark?"dark":"kennedy";this.url=$A.originUrl("drawio/?embed=1&chrome=".concat(e,"&lightbox=").concat(n,"&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&ui=").concat(a,"&lang=").concat(t,"&spin=1&proto=json"))},mounted:function(){window.addEventListener("message",this.handleMessage)},beforeDestroy:function(){window.removeEventListener("message",this.handleMessage)},watch:{value:{handler:function(t){this.bakData!=$A.jsonStringify(t)&&(this.bakData=$A.jsonStringify(t),this.updateContent())},deep:!0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,a.rn)(["themeIsDark"])),methods:{formatZoom:function(t){return t+"%"},updateContent:function(){this.$refs.myFlow.contentWindow.postMessage(JSON.stringify({action:"load",autosave:1,xml:this.value.xml}),"*")},handleMessage:function(t){var e=$A.originUrl("drawio/"),n=this.$refs.myFlow.contentWindow;if(e.includes(t.origin)){var a=$A.jsonParse(t.data);switch(a.event){case"init":this.loadIng=!1,this.updateContent();break;case"load":void 0===this.value.xml&&n.postMessage(JSON.stringify({action:"template"}),"*");break;case"autosave":var o={xml:a.xml};this.bakData=$A.jsonStringify(o),this.$emit("input",o);break;case"save":this.$emit("saveData")}}}}};var s=n(93379),c=n.n(s),l=n(80550),d={insert:"head",singleton:!1};c()(l.Z,d);l.Z.locals;const u=(0,n(51900).Z)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"drawio-content"},[n("iframe",{ref:"myFlow",staticClass:"drawio-iframe",attrs:{src:t.url}}),t._v(" "),t.loadIng?n("div",{staticClass:"drawio-loading"},[n("Loading")],1):t._e()])}),[],!1,null,"29b5583c",null).exports}}]);
|
|
2
public/js/build/471.js
vendored
2
public/js/build/471.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/606.js
vendored
2
public/js/build/606.js
vendored
File diff suppressed because one or more lines are too long
1
public/js/build/842.js
vendored
Normal file
1
public/js/build/842.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[842],{13509:(t,e,n)=>{n.d(e,{Z:()=>r});var a=n(1519),o=n.n(a)()((function(t){return t[1]}));o.push([t.id,".drawio-content[data-v-543194db],.drawio-content .drawio-iframe[data-v-543194db]{height:100%;left:0;position:absolute;top:0;width:100%}.drawio-content .drawio-iframe[data-v-543194db]{background:0 0;border:0;float:none;margin:-1px 0 0;max-width:none;outline:0;padding:0}.drawio-content .drawio-loading[data-v-543194db]{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}",""]);const r=o},29842:(t,e,n)=>{n.r(e),n.d(e,{default:()=>u});var a=n(20629);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const i={name:"Drawio",props:{value:{type:Object,default:function(){return{}}},readOnly:{type:Boolean,default:!1}},data:function(){return{loadIng:!0,url:null,bakData:""}},created:function(){var t="en";switch(this.getLanguage()){case"CN":case"TC":t="zh"}var e=this.readOnly?0:1,n=this.readOnly?1:0,a=this.themeIsDark?"dark":"kennedy";this.url=$A.apiUrl("../drawio/?chrome=".concat(e,"&lightbox=").concat(n,"&ui=").concat(a,"&lang=").concat(t,"&embed=1&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&spin=1&proto=json"))},mounted:function(){window.addEventListener("message",this.handleMessage)},beforeDestroy:function(){window.removeEventListener("message",this.handleMessage)},watch:{value:{handler:function(t){this.bakData!=$A.jsonStringify(t)&&(this.bakData=$A.jsonStringify(t),this.updateContent())},deep:!0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,a.rn)(["themeIsDark"])),methods:{formatZoom:function(t){return t+"%"},updateContent:function(){this.$refs.myFlow.contentWindow.postMessage(JSON.stringify({action:"load",autosave:1,xml:this.value.xml}),"*")},handleMessage:function(t){var e=$A.originUrl("drawio/"),n=this.$refs.myFlow.contentWindow;if(e.includes(t.origin)){var a=$A.jsonParse(t.data);switch(a.event){case"init":this.loadIng=!1,this.updateContent();break;case"load":void 0===this.value.xml&&n.postMessage(JSON.stringify({action:"template"}),"*");break;case"autosave":var o={xml:a.xml};this.bakData=$A.jsonStringify(o),this.$emit("input",o);break;case"save":this.$emit("saveData")}}}}};var s=n(93379),c=n.n(s),d=n(13509),l={insert:"head",singleton:!1};c()(d.Z,l);d.Z.locals;const u=(0,n(51900).Z)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"drawio-content"},[n("iframe",{ref:"myFlow",staticClass:"drawio-iframe",attrs:{src:t.url}}),t._v(" "),t.loadIng?n("div",{staticClass:"drawio-loading"},[n("Loading")],1):t._e()])}),[],!1,null,"543194db",null).exports}}]);
|
2
public/js/build/954.js
vendored
2
public/js/build/954.js
vendored
File diff suppressed because one or more lines are too long
@ -70,7 +70,7 @@ export default {
|
|||||||
let chrome = this.readOnly ? 0 : 1;
|
let chrome = this.readOnly ? 0 : 1;
|
||||||
let lightbox = this.readOnly ? 1 : 0;
|
let lightbox = this.readOnly ? 1 : 0;
|
||||||
let theme = this.themeIsDark ? 'dark' : 'kennedy'
|
let theme = this.themeIsDark ? 'dark' : 'kennedy'
|
||||||
this.url = $A.originUrl(`drawio/?embed=1&chrome=${chrome}&lightbox=${lightbox}&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&ui=${theme}&lang=${language}&spin=1&proto=json`);
|
this.url = $A.apiUrl(`../drawio/?chrome=${chrome}&lightbox=${lightbox}&ui=${theme}&lang=${language}&embed=1&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&spin=1&proto=json`);
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('message', this.handleMessage)
|
window.addEventListener('message', this.handleMessage)
|
||||||
|
@ -1,216 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flow-content">
|
|
||||||
<iframe ref="myFlow" class="flow-iframe" :src="url"></iframe>
|
|
||||||
<div v-if="loadIng" class="flow-loading"><Loading/></div>
|
|
||||||
<div v-if="readOnly && zoom > 0" class="zoom-box" :class="{'zoom-ing': zoomIng}">
|
|
||||||
<div class="zoom-svg">
|
|
||||||
<svg t="1600613502044" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1161" width="18" height="18"><path d="M598.646154 401.723077H279.630769c-15.753846 0-27.569231 11.815385-27.569231 31.507692 0 15.753846 11.815385 27.569231 31.507693 27.569231h319.015384c15.753846 0 27.569231-11.815385 27.569231-31.507692 0-15.753846-15.753846-27.569231-31.507692-27.569231z" fill="#666666" p-id="1162"></path><path d="M921.6 850.707692l-204.8-196.923077c47.261538-59.076923 78.769231-137.846154 78.769231-220.553846 0-196.923077-157.538462-354.461538-354.461539-354.461538s-354.461538 157.538462-354.461538 354.461538 157.538462 354.461538 354.461538 354.461539c90.584615 0 173.292308-35.446154 236.307693-90.584616l204.8 196.923077c3.938462 3.938462 11.815385 7.876923 19.692307 7.876923s15.753846-3.938462 19.692308-7.876923c11.815385-15.753846 11.815385-35.446154 0-43.323077z m-484.430769-126.030769c-161.476923 0-295.384615-133.907692-295.384616-295.384615S275.692308 133.907692 437.169231 133.907692s295.384615 133.907692 295.384615 295.384616-129.969231 295.384615-295.384615 295.384615z" fill="#666666" p-id="1163"></path></svg>
|
|
||||||
<svg t="1600613514136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1403" width="18" height="18"><path d="M929.476923 854.646154l-212.676923-200.861539c47.261538-59.076923 78.769231-137.846154 78.769231-220.553846 0-196.923077-157.538462-354.461538-354.461539-354.461538s-354.461538 157.538462-354.461538 354.461538 157.538462 354.461538 354.461538 354.461539c90.584615 0 173.292308-35.446154 236.307693-90.584616l212.676923 200.861539c3.938462 3.938462 11.815385 7.876923 19.692307 7.876923s15.753846-3.938462 19.692308-7.876923c11.815385-11.815385 11.815385-31.507692 0-43.323077z m-488.369231-126.030769c-161.476923 0-295.384615-133.907692-295.384615-295.384616s133.907692-295.384615 295.384615-295.384615 295.384615 133.907692 295.384616 295.384615-133.907692 295.384615-295.384616 295.384616z" fill="#666666" p-id="1404"></path><path d="M598.646154 401.723077h-129.969231V271.753846c0-15.753846-11.815385-31.507692-31.507692-31.507692s-31.507692 11.815385-31.507693 31.507692v129.969231H279.630769c-15.753846 0-31.507692 11.815385-31.507692 31.507692s11.815385 31.507692 31.507692 31.507693h129.969231V590.769231c0 15.753846 11.815385 31.507692 31.507692 31.507692s31.507692-11.815385 31.507693-31.507692v-129.969231h129.96923c15.753846 0 31.507692-11.815385 31.507693-31.507692s-15.753846-27.569231-35.446154-27.569231z" fill="#666666" p-id="1405"></path></svg>
|
|
||||||
</div>
|
|
||||||
<Slider class="zoom-slider" v-model="zoom" :min="1" :max="300" :tip-format="formatZoom" @on-change="zoomIng=false" @on-input="zoomIng=true"></Slider>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.flow-content {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
.flow-iframe {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: 0 0;
|
|
||||||
border: 0;
|
|
||||||
float: none;
|
|
||||||
margin: -1px 0 0;
|
|
||||||
max-width: none;
|
|
||||||
outline: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.flow-loading {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
|
||||||
.zoom-box {
|
|
||||||
position: absolute;
|
|
||||||
left: 20px;
|
|
||||||
bottom: 20px;
|
|
||||||
height: 34px;
|
|
||||||
max-width: 50%;
|
|
||||||
border-radius: 3px;
|
|
||||||
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
|
|
||||||
background-color: #fff;
|
|
||||||
color: #666;
|
|
||||||
z-index: 10;
|
|
||||||
padding: 0 6px;
|
|
||||||
.zoom-svg {
|
|
||||||
height: 34px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.icon {
|
|
||||||
margin: 0 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.zoom-slider {
|
|
||||||
display: none;
|
|
||||||
padding: 0 10px;
|
|
||||||
width: 300px;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
&:hover,
|
|
||||||
&.zoom-ing {
|
|
||||||
.zoom-svg {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.zoom-slider {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
import JSPDF from "jspdf";
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Flow",
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
readOnly: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loadIng: true,
|
|
||||||
|
|
||||||
url: null,
|
|
||||||
|
|
||||||
zoom: -1,
|
|
||||||
zoomIng: false,
|
|
||||||
|
|
||||||
bakData: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
let language = 'en';
|
|
||||||
switch (this.getLanguage()) {
|
|
||||||
case 'CN':
|
|
||||||
case 'TC':
|
|
||||||
language = 'zh'
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
let route = this.readOnly ? 'viewer' : 'index';
|
|
||||||
let theme = this.themeIsDark ? 'dark' : 'light'
|
|
||||||
this.url = $A.originUrl('js/grapheditor/' + route + '.html?lang=' + language + '&theme=' + theme);
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('message', this.handleMessage)
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
window.removeEventListener('message', this.handleMessage)
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
value: {
|
|
||||||
handler(val) {
|
|
||||||
if (this.bakData == $A.jsonStringify(val)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.bakData = $A.jsonStringify(val);
|
|
||||||
this.updateContent();
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
},
|
|
||||||
zoom(val) {
|
|
||||||
this.$refs.myFlow.contentWindow.postMessage({
|
|
||||||
act: 'zoom',
|
|
||||||
params: {
|
|
||||||
zoom: val / 100
|
|
||||||
}
|
|
||||||
}, '*')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(['themeIsDark'])
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
formatZoom(val) {
|
|
||||||
return val + '%';
|
|
||||||
},
|
|
||||||
|
|
||||||
updateContent() {
|
|
||||||
this.zoom = Math.max(1, (typeof this.value.scale === "number" ? this.value.scale : 1) * 100)
|
|
||||||
this.$refs.myFlow.contentWindow.postMessage({
|
|
||||||
act: 'setXml',
|
|
||||||
params: Object.assign(this.value, typeof this.value.xml === "undefined" ? {
|
|
||||||
xml: this.value.content
|
|
||||||
} : {})
|
|
||||||
}, '*')
|
|
||||||
},
|
|
||||||
|
|
||||||
handleMessage (event) {
|
|
||||||
const data = event.data;
|
|
||||||
switch (data.act) {
|
|
||||||
case 'ready':
|
|
||||||
this.loadIng = false;
|
|
||||||
this.updateContent();
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'change':
|
|
||||||
this.bakData = $A.jsonStringify(data.params);
|
|
||||||
this.$emit('input', data.params);
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'save':
|
|
||||||
this.$emit('saveData');
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'imageContent':
|
|
||||||
let pdf = new JSPDF({
|
|
||||||
format: [data.params.width, data.params.height]
|
|
||||||
});
|
|
||||||
pdf.addImage(data.params.content, 'PNG', 0, 0, 0, 0);
|
|
||||||
pdf.save(`${data.params.name}.pdf`);
|
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
exportPNG(name, scale = 10) {
|
|
||||||
this.$refs.myFlow.contentWindow.postMessage({
|
|
||||||
act: 'exportPNG',
|
|
||||||
params: {
|
|
||||||
name: name || this.$L('无标题'),
|
|
||||||
scale: scale,
|
|
||||||
type: 'png',
|
|
||||||
}
|
|
||||||
}, '*')
|
|
||||||
},
|
|
||||||
|
|
||||||
exportPDF(name, scale = 10) {
|
|
||||||
this.$refs.myFlow.contentWindow.postMessage({
|
|
||||||
act: 'exportPNG',
|
|
||||||
params: {
|
|
||||||
name: name || this.$L('无标题'),
|
|
||||||
scale: scale,
|
|
||||||
type: 'imageContent',
|
|
||||||
}
|
|
||||||
}, '*')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
Loading…
x
Reference in New Issue
Block a user