11.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. webpackJsonp([11],{
  2. /***/ 456:
  3. /***/ (function(module, exports, __webpack_require__) {
  4. var disposed = false
  5. function injectStyle (ssrContext) {
  6. if (disposed) return
  7. __webpack_require__(965)
  8. }
  9. var normalizeComponent = __webpack_require__(2)
  10. /* script */
  11. var __vue_script__ = __webpack_require__(967)
  12. /* template */
  13. var __vue_template__ = __webpack_require__(968)
  14. /* template functional */
  15. var __vue_template_functional__ = false
  16. /* styles */
  17. var __vue_styles__ = injectStyle
  18. /* scopeId */
  19. var __vue_scopeId__ = "data-v-97cb6240"
  20. /* moduleIdentifier (server only) */
  21. var __vue_module_identifier__ = null
  22. var Component = normalizeComponent(
  23. __vue_script__,
  24. __vue_template__,
  25. __vue_template_functional__,
  26. __vue_styles__,
  27. __vue_scopeId__,
  28. __vue_module_identifier__
  29. )
  30. Component.options.__file = "resources/assets/js/main/components/docs/flow/index.vue"
  31. /* hot reload */
  32. if (false) {(function () {
  33. var hotAPI = require("vue-hot-reload-api")
  34. hotAPI.install(require("vue"), false)
  35. if (!hotAPI.compatible) return
  36. module.hot.accept()
  37. if (!module.hot.data) {
  38. hotAPI.createRecord("data-v-97cb6240", Component.options)
  39. } else {
  40. hotAPI.reload("data-v-97cb6240", Component.options)
  41. }
  42. module.hot.dispose(function (data) {
  43. disposed = true
  44. })
  45. })()}
  46. module.exports = Component.exports
  47. /***/ }),
  48. /***/ 965:
  49. /***/ (function(module, exports, __webpack_require__) {
  50. // style-loader: Adds some css to the DOM by adding a <style> tag
  51. // load the styles
  52. var content = __webpack_require__(966);
  53. if(typeof content === 'string') content = [[module.i, content, '']];
  54. if(content.locals) module.exports = content.locals;
  55. // add the styles to the DOM
  56. var update = __webpack_require__(1)("71cfe6dc", content, false, {});
  57. // Hot Module Replacement
  58. if(false) {
  59. // When the styles change, update the <style> tags
  60. if(!content.locals) {
  61. module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-97cb6240\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() {
  62. var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-97cb6240\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue");
  63. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  64. update(newContent);
  65. });
  66. }
  67. // When the module is disposed, remove the <style> tags
  68. module.hot.dispose(function() { update(); });
  69. }
  70. /***/ }),
  71. /***/ 966:
  72. /***/ (function(module, exports, __webpack_require__) {
  73. exports = module.exports = __webpack_require__(0)(false);
  74. // imports
  75. // module
  76. exports.push([module.i, "\n.flow-content[data-v-97cb6240] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.flow-content .flow-iframe[data-v-97cb6240] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: 0 0;\n border: 0;\n float: none;\n margin: -1px 0 0;\n max-width: none;\n outline: 0;\n padding: 0;\n}\n.flow-content .flow-loading[data-v-97cb6240] {\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n}\n.flow-content .zoom-box[data-v-97cb6240] {\n position: absolute;\n left: 20px;\n bottom: 20px;\n height: 34px;\n max-width: 50%;\n border-radius: 3px;\n -webkit-box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);\n box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);\n background-color: #fff;\n color: #666;\n z-index: 10;\n padding: 0 6px;\n}\n.flow-content .zoom-box .zoom-svg[data-v-97cb6240] {\n height: 34px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.flow-content .zoom-box .zoom-svg .icon[data-v-97cb6240] {\n margin: 0 6px;\n}\n.flow-content .zoom-box .zoom-slider[data-v-97cb6240] {\n display: none;\n padding: 0 10px;\n width: 300px;\n max-width: 100%;\n}\n.flow-content .zoom-box:hover .zoom-svg[data-v-97cb6240], .flow-content .zoom-box.zoom-ing .zoom-svg[data-v-97cb6240] {\n display: none;\n}\n.flow-content .zoom-box:hover .zoom-slider[data-v-97cb6240], .flow-content .zoom-box.zoom-ing .zoom-slider[data-v-97cb6240] {\n display: inline-block;\n}\n", ""]);
  77. // exports
  78. /***/ }),
  79. /***/ 967:
  80. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81. "use strict";
  82. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  83. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jspdf__ = __webpack_require__(328);
  84. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jspdf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jspdf__);
  85. //
  86. //
  87. //
  88. //
  89. //
  90. //
  91. //
  92. //
  93. //
  94. //
  95. //
  96. //
  97. //
  98. //
  99. //
  100. //
  101. //
  102. //
  103. //
  104. //
  105. //
  106. //
  107. //
  108. //
  109. //
  110. //
  111. //
  112. //
  113. //
  114. //
  115. //
  116. //
  117. //
  118. //
  119. //
  120. //
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. //
  129. //
  130. //
  131. //
  132. //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  139. //
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //
  149. //
  150. //
  151. //
  152. //
  153. //
  154. //
  155. //
  156. //
  157. //
  158. //
  159. //
  160. //
  161. //
  162. //
  163. //
  164. /* harmony default export */ __webpack_exports__["default"] = ({
  165. name: "Flow",
  166. props: {
  167. value: {
  168. type: Object,
  169. default: function _default() {
  170. return {};
  171. }
  172. },
  173. readOnly: {
  174. type: Boolean,
  175. default: false
  176. }
  177. },
  178. data: function data() {
  179. return {
  180. loadIng: true,
  181. url: null,
  182. zoom: -1,
  183. zoomIng: false,
  184. bakData: ''
  185. };
  186. },
  187. created: function created() {
  188. this.url = window.location.origin + '/js/grapheditor/' + (this.readOnly ? 'viewer' : 'index') + '.html?lang=' + (this.getLanguage() === 'zh' ? 'zh' : 'en');
  189. },
  190. mounted: function mounted() {
  191. window.addEventListener('message', this.handleMessage);
  192. },
  193. beforeDestroy: function beforeDestroy() {
  194. window.removeEventListener('message', this.handleMessage);
  195. },
  196. watch: {
  197. value: {
  198. handler: function handler(val) {
  199. if (this.bakData == $A.jsonStringify(val)) {
  200. return;
  201. }
  202. this.bakData = $A.jsonStringify(val);
  203. this.updateContent();
  204. },
  205. deep: true
  206. },
  207. zoom: function zoom(val) {
  208. this.$refs.myFlow.contentWindow.postMessage({
  209. act: 'zoom',
  210. params: {
  211. zoom: val / 100
  212. }
  213. }, '*');
  214. }
  215. },
  216. methods: {
  217. formatZoom: function formatZoom(val) {
  218. return val + '%';
  219. },
  220. updateContent: function updateContent() {
  221. this.zoom = Math.max(1, (typeof this.value.scale === "number" ? this.value.scale : 1) * 100);
  222. this.$refs.myFlow.contentWindow.postMessage({
  223. act: 'setXml',
  224. params: Object.assign(this.value, typeof this.value.xml === "undefined" ? {
  225. xml: this.value.content
  226. } : {})
  227. }, '*');
  228. },
  229. handleMessage: function handleMessage(event) {
  230. var data = event.data;
  231. switch (data.act) {
  232. case 'ready':
  233. this.loadIng = false;
  234. this.updateContent();
  235. break;
  236. case 'change':
  237. this.bakData = $A.jsonStringify(data.params);
  238. this.$emit('input', data.params);
  239. break;
  240. case 'save':
  241. this.$emit('saveData');
  242. break;
  243. case 'imageContent':
  244. var pdf = new __WEBPACK_IMPORTED_MODULE_0_jspdf___default.a({
  245. format: [data.params.width, data.params.height]
  246. });
  247. pdf.addImage(data.params.content, 'PNG', 0, 0, 0, 0);
  248. pdf.save(data.params.name + ".pdf");
  249. break;
  250. }
  251. },
  252. exportPNG: function exportPNG(name) {
  253. var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
  254. this.$refs.myFlow.contentWindow.postMessage({
  255. act: 'exportPNG',
  256. params: {
  257. name: name || this.$L('无标题'),
  258. scale: scale,
  259. type: 'png'
  260. }
  261. }, '*');
  262. },
  263. exportPDF: function exportPDF(name) {
  264. var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
  265. this.$refs.myFlow.contentWindow.postMessage({
  266. act: 'exportPNG',
  267. params: {
  268. name: name || this.$L('无标题'),
  269. scale: scale,
  270. type: 'imageContent'
  271. }
  272. }, '*');
  273. }
  274. }
  275. });
  276. /***/ }),
  277. /***/ 968:
  278. /***/ (function(module, exports, __webpack_require__) {
  279. var render = function() {
  280. var _vm = this
  281. var _h = _vm.$createElement
  282. var _c = _vm._self._c || _h
  283. return _c("div", { staticClass: "flow-content" }, [
  284. _c("iframe", {
  285. ref: "myFlow",
  286. staticClass: "flow-iframe",
  287. attrs: { src: _vm.url }
  288. }),
  289. _vm._v(" "),
  290. _vm.loadIng
  291. ? _c("div", { staticClass: "flow-loading" }, [_c("w-loading")], 1)
  292. : _vm._e(),
  293. _vm._v(" "),
  294. _vm.readOnly && _vm.zoom > 0
  295. ? _c(
  296. "div",
  297. { staticClass: "zoom-box", class: { "zoom-ing": _vm.zoomIng } },
  298. [
  299. _c("div", { staticClass: "zoom-svg" }, [
  300. _c(
  301. "svg",
  302. {
  303. staticClass: "icon",
  304. attrs: {
  305. t: "1600613502044",
  306. viewBox: "0 0 1024 1024",
  307. version: "1.1",
  308. xmlns: "http://www.w3.org/2000/svg",
  309. "p-id": "1161",
  310. width: "18",
  311. height: "18"
  312. }
  313. },
  314. [
  315. _c("path", {
  316. attrs: {
  317. d:
  318. "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",
  319. fill: "#666666",
  320. "p-id": "1162"
  321. }
  322. }),
  323. _c("path", {
  324. attrs: {
  325. d:
  326. "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",
  327. fill: "#666666",
  328. "p-id": "1163"
  329. }
  330. })
  331. ]
  332. ),
  333. _vm._v(" "),
  334. _c(
  335. "svg",
  336. {
  337. staticClass: "icon",
  338. attrs: {
  339. t: "1600613514136",
  340. viewBox: "0 0 1024 1024",
  341. version: "1.1",
  342. xmlns: "http://www.w3.org/2000/svg",
  343. "p-id": "1403",
  344. width: "18",
  345. height: "18"
  346. }
  347. },
  348. [
  349. _c("path", {
  350. attrs: {
  351. d:
  352. "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",
  353. fill: "#666666",
  354. "p-id": "1404"
  355. }
  356. }),
  357. _c("path", {
  358. attrs: {
  359. d:
  360. "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",
  361. fill: "#666666",
  362. "p-id": "1405"
  363. }
  364. })
  365. ]
  366. )
  367. ]),
  368. _vm._v(" "),
  369. _c("Slider", {
  370. staticClass: "zoom-slider",
  371. attrs: { min: 1, max: 300, "tip-format": _vm.formatZoom },
  372. on: {
  373. "on-change": function($event) {
  374. _vm.zoomIng = false
  375. },
  376. "on-input": function($event) {
  377. _vm.zoomIng = true
  378. }
  379. },
  380. model: {
  381. value: _vm.zoom,
  382. callback: function($$v) {
  383. _vm.zoom = $$v
  384. },
  385. expression: "zoom"
  386. }
  387. })
  388. ],
  389. 1
  390. )
  391. : _vm._e()
  392. ])
  393. }
  394. var staticRenderFns = []
  395. render._withStripped = true
  396. module.exports = { render: render, staticRenderFns: staticRenderFns }
  397. if (false) {
  398. module.hot.accept()
  399. if (module.hot.data) {
  400. require("vue-hot-reload-api") .rerender("data-v-97cb6240", module.exports)
  401. }
  402. }
  403. /***/ })
  404. });