commit
97c009bc3e
@ -32,7 +32,6 @@
|
|||||||
"jquery.fancytree": "^2.35.0",
|
"jquery.fancytree": "^2.35.0",
|
||||||
"js-cookie": "2.2.0",
|
"js-cookie": "2.2.0",
|
||||||
"jshint": "^2.11.1",
|
"jshint": "^2.11.1",
|
||||||
"jspdf": "^2.5.1",
|
|
||||||
"less-loader": "^6.1.0",
|
"less-loader": "^6.1.0",
|
||||||
"lib-flexible": "^0.3.2",
|
"lib-flexible": "^0.3.2",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
@ -40,6 +39,7 @@
|
|||||||
"monaco-editor-vue": "^1.0.10",
|
"monaco-editor-vue": "^1.0.10",
|
||||||
"monaco-editor-webpack-plugin": "^3.0.1",
|
"monaco-editor-webpack-plugin": "^3.0.1",
|
||||||
"monaco-languages": "^2.3.0",
|
"monaco-languages": "^2.3.0",
|
||||||
|
"mxcad": "^1.0.238",
|
||||||
"normalize.css": "7.0.0",
|
"normalize.css": "7.0.0",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"path-to-regexp": "2.4.0",
|
"path-to-regexp": "2.4.0",
|
||||||
|
|||||||
BIN
public/resource/mxcad/fonts/complex.shx
Normal file
BIN
public/resource/mxcad/fonts/complex.shx
Normal file
Binary file not shown.
BIN
public/resource/mxcad/fonts/gbcbig.shx
Normal file
BIN
public/resource/mxcad/fonts/gbcbig.shx
Normal file
Binary file not shown.
BIN
public/resource/mxcad/fonts/hztxt.shx
Normal file
BIN
public/resource/mxcad/fonts/hztxt.shx
Normal file
Binary file not shown.
101
public/resource/mxcad/fonts/mx.lin
Normal file
101
public/resource/mxcad/fonts/mx.lin
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
*BORDER,Border __ __ . __ __ . __ __ . __ __ . __ __ .
|
||||||
|
A,.5,-.25,.5,-.25,0,-.25
|
||||||
|
*BORDER2,Border (.5x) __.__.__.__.__.__.__.__.__.__.__.
|
||||||
|
A,.25,-.125,.25,-.125,0,-.125
|
||||||
|
*BORDERX2,Border (2x) ____ ____ . ____ ____ . ___
|
||||||
|
A,1.0,-.5,1.0,-.5,0,-.5
|
||||||
|
|
||||||
|
*CENTER,Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
|
||||||
|
A,1.25,-.25,.25,-.25
|
||||||
|
*CENTER2,Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
|
||||||
|
A,.75,-.125,.125,-.125
|
||||||
|
*CENTERX2,Center (2x) ________ __ ________ __ _____
|
||||||
|
A,2.5,-.5,.5,-.5
|
||||||
|
|
||||||
|
*DASHDOT,Dash dot __ . __ . __ . __ . __ . __ . __ . __
|
||||||
|
A,.5,-.25,0,-.25
|
||||||
|
*DASHDOT2,Dash dot (.5x) _._._._._._._._._._._._._._._.
|
||||||
|
A,.25,-.125,0,-.125
|
||||||
|
*DASHDOTX2,Dash dot (2x) ____ . ____ . ____ . ___
|
||||||
|
A,1.0,-.5,0,-.5
|
||||||
|
|
||||||
|
*DASHED,Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _
|
||||||
|
A,.5,-.25
|
||||||
|
*DASHED2,Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
A,.25,-.125
|
||||||
|
*DASHEDX2,Dashed (2x) ____ ____ ____ ____ ____ ___
|
||||||
|
A,1.0,-.5
|
||||||
|
|
||||||
|
*DIVIDE,Divide ____ . . ____ . . ____ . . ____ . . ____
|
||||||
|
A,.5,-.25,0,-.25,0,-.25
|
||||||
|
*DIVIDE2,Divide (.5x) __..__..__..__..__..__..__..__.._
|
||||||
|
A,.25,-.125,0,-.125,0,-.125
|
||||||
|
*DIVIDEX2,Divide (2x) ________ . . ________ . . _
|
||||||
|
A,1.0,-.5,0,-.5,0,-.5
|
||||||
|
|
||||||
|
*DOT,Dot . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
A,0,-.25
|
||||||
|
*DOT2,Dot (.5x) ........................................
|
||||||
|
A,0,-.125
|
||||||
|
*DOTX2,Dot (2x) . . . . . . . . . . . . . .
|
||||||
|
A,0,-.5
|
||||||
|
|
||||||
|
*HIDDEN,Hidden __ __ __ __ __ __ __ __ __ __ __ __ __ __
|
||||||
|
A,.25,-.125
|
||||||
|
*HIDDEN2,Hidden (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
A,.125,-.0625
|
||||||
|
*HIDDENX2,Hidden (2x) ____ ____ ____ ____ ____ ____ ____
|
||||||
|
A,.5,-.25
|
||||||
|
|
||||||
|
*PHANTOM,Phantom ______ __ __ ______ __ __ ______
|
||||||
|
A,1.25,-.25,.25,-.25,.25,-.25
|
||||||
|
*PHANTOM2,Phantom (.5x) ___ _ _ ___ _ _ ___ _ _ ___ _ _
|
||||||
|
A,.625,-.125,.125,-.125,.125,-.125
|
||||||
|
*PHANTOMX2,Phantom (2x) ____________ ____ ____ _
|
||||||
|
A,2.5,-.5,.5,-.5,.5,-.5
|
||||||
|
|
||||||
|
*ACAD_ISO02W100,ISO dash __ __ __ __ __ __ __ __ __ __ __ __ __
|
||||||
|
A,12,-3
|
||||||
|
*ACAD_ISO03W100,ISO dash space __ __ __ __ __ __
|
||||||
|
A,12,-18
|
||||||
|
*ACAD_ISO04W100,ISO long-dash dot ____ . ____ . ____ . ____ . _
|
||||||
|
A,24,-3,0,-3
|
||||||
|
*ACAD_ISO05W100,ISO long-dash double-dot ____ .. ____ .. ____ .
|
||||||
|
A,24,-3,0,-3,0,-3
|
||||||
|
*ACAD_ISO06W100,ISO long-dash triple-dot ____ ... ____ ... ____
|
||||||
|
A,24,-3,0,-3,0,-3,0,-3
|
||||||
|
*ACAD_ISO07W100,ISO dot . . . . . . . . . . . . . . . . . . . .
|
||||||
|
A,0,-3
|
||||||
|
*ACAD_ISO08W100,ISO long-dash short-dash ____ __ ____ __ ____ _
|
||||||
|
A,24,-3,6,-3
|
||||||
|
*ACAD_ISO09W100,ISO long-dash double-short-dash ____ __ __ ____
|
||||||
|
A,24,-3,6,-3,6,-3
|
||||||
|
*ACAD_ISO10W100,ISO dash dot __ . __ . __ . __ . __ . __ . __ .
|
||||||
|
A,12,-3,0,-3
|
||||||
|
*ACAD_ISO11W100,ISO double-dash dot __ __ . __ __ . __ __ . __ _
|
||||||
|
A,12,-3,12,-3,0,-3
|
||||||
|
*ACAD_ISO12W100,ISO dash double-dot __ . . __ . . __ . . __ . .
|
||||||
|
A,12,-3,0,-3,0,-3
|
||||||
|
*ACAD_ISO13W100,ISO double-dash double-dot __ __ . . __ __ . . _
|
||||||
|
A,12,-3,12,-3,0,-3,0,-3
|
||||||
|
*ACAD_ISO14W100,ISO dash triple-dot __ . . . __ . . . __ . . . _
|
||||||
|
A,12,-3,0,-3,0,-3,0,-3
|
||||||
|
*ACAD_ISO15W100,ISO double-dash triple-dot __ __ . . . __ __ . .
|
||||||
|
A,12,-3,12,-3,0,-3,0,-3,0,-3
|
||||||
|
|
||||||
|
*FENCELINE1,Fenceline circle ----0-----0----0-----0----0-----0--
|
||||||
|
A,.25,-.1,[CIRC1,ltypeshp.shx,x=-.1,s=.1],-.1,1
|
||||||
|
*FENCELINE2,Fenceline square ----[]-----[]----[]-----[]----[]---
|
||||||
|
A,.25,-.1,[BOX,ltypeshp.shx,x=-.1,s=.1],-.1,1
|
||||||
|
*TRACKS,Tracks -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
|
||||||
|
A,.15,[TRACK1,ltypeshp.shx,s=.25],.15
|
||||||
|
*BATTING,Batting SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
|
||||||
|
A,.0001,-.1,[BAT,ltypeshp.shx,x=-.1,s=.1],-.2,[BAT,ltypeshp.shx,r=180,x=.1,s=.1],-.1
|
||||||
|
*HOT_WATER_SUPPLY,Hot water supply ---- HW ---- HW ---- HW ----
|
||||||
|
A,.5,-.2,["HW",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2
|
||||||
|
*GAS_LINE,Gas line ----GAS----GAS----GAS----GAS----GAS----GAS--
|
||||||
|
A,.5,-.2,["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.25
|
||||||
|
*ZIGZAG,Zig zag /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
|
||||||
|
A,.0001,-.2,[ZIG,ltypeshp.shx,x=-.2,s=.2],-.4,[ZIG,ltypeshp.shx,r=180,x=.2,s=.2],-.2
|
||||||
|
|
||||||
|
|
||||||
29
public/resource/mxcad/fonts/mx.pat
Normal file
29
public/resource/mxcad/fonts/mx.pat
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
*SOLID, 实体填充
|
||||||
|
45, 0,0, 0,.125
|
||||||
|
*ANGLE, 角钢
|
||||||
|
0, 0,0, 0,.275, .2,-.075
|
||||||
|
90, 0, 0,.275,0, .2,-.075
|
||||||
|
*ANSI31, ANSI 铁、砖和石
|
||||||
|
45, 0,0, 0,.125
|
||||||
|
*ANSI32, ANSI 钢
|
||||||
|
45, 0,0, 0,.375
|
||||||
|
45, .176776695,0, 0,.375
|
||||||
|
*ANSI33, ANSI 青铜、黄铜和紫铜
|
||||||
|
45, 0,0, 0,.25
|
||||||
|
45, .176776695,0, 0,.25, .125,-.0625
|
||||||
|
*ANSI34, ANSI 塑料和橡胶
|
||||||
|
45, 0,0, 0,.75
|
||||||
|
45, .176776695,0, 0,.75
|
||||||
|
45, .353553391,0, 0,.75
|
||||||
|
45, .530330086,0, 0,.75
|
||||||
|
*ANSI35, ANSI 耐火砖和耐火材料
|
||||||
|
45, 0,0, 0,.25
|
||||||
|
45, .176776695,0, 0,.25, .3125,-.0625,0,-.0625
|
||||||
|
*ANSI36, ANSI 大理石、板岩和玻璃
|
||||||
|
45, 0,0, .21875,.125, .3125,-.0625,0,-.0625
|
||||||
|
*ANSI37, ANSI 铅、锌、镁和声/热/电绝缘体
|
||||||
|
45, 0,0, 0,.125
|
||||||
|
135, 0,0, 0,.125
|
||||||
|
*ANSI38, ANSI 铝
|
||||||
|
45, 0,0, 0,.125
|
||||||
|
135, 0,0, .25,.125, .3125,-.1875
|
||||||
32
public/resource/mxcad/fonts/mxiso.pat
Normal file
32
public/resource/mxcad/fonts/mxiso.pat
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
*ACAD_ISO02W100, 划线
|
||||||
|
0, 0,0, 0,5, 12,-3
|
||||||
|
*ACAD_ISO03W100, 划、空格线
|
||||||
|
0, 0,0, 0,5, 12,-18
|
||||||
|
*ACAD_ISO04W100, 长划、点线
|
||||||
|
0, 0,0, 0,5, 24,-3,.5,-3
|
||||||
|
*ACAD_ISO05W100, 长划、双点线
|
||||||
|
0, 0,0, 0,5, 24,-3,.5,-3,.5,-3
|
||||||
|
*ACAD_ISO06W100, 长划、三点线
|
||||||
|
0, 0,0, 0,5, 24,-3,.5,-3,.5,-6.5
|
||||||
|
0, 0,0, 0,5, -34,.5,-3
|
||||||
|
*ACAD_ISO07W100, 点线
|
||||||
|
0, 0,0, 0,5, .5,-3
|
||||||
|
*ACAD_ISO08W100, 长划、短划线
|
||||||
|
0, 0,0, 0,5, 24,-3,6,-3
|
||||||
|
*ACAD_ISO09W100, 长划、双短划线
|
||||||
|
0, 0,0, 0,5, 24,-3,6,-3,6,-3
|
||||||
|
*ACAD_ISO10W100, 划、点线
|
||||||
|
0, 0,0, 0,5, 12,-3,.5,-3
|
||||||
|
*ACAD_ISO11W100, 双划、点线
|
||||||
|
0, 0,0, 0,5, 12,-3,12,-3,.5,-3
|
||||||
|
*ACAD_ISO12W100, 划、双点线
|
||||||
|
0, 0,0, 0,5, 12,-3,.5,-3,.5,-3
|
||||||
|
*ACAD_ISO13W100, 双划、双点线
|
||||||
|
0, 0,0, 0,5, 12,-3,12,-3,.5,-6.5
|
||||||
|
0, 0,0, 0,5, -33.5,.5,-3
|
||||||
|
*ACAD_ISO14W100, 划、三点线
|
||||||
|
0, 0,0, 0,5, 12,-3,.5,-3,.5,-6.5
|
||||||
|
0, 0,0, 0,5, -22,.5,-3
|
||||||
|
*ACAD_ISO15W100, 双划、三点线
|
||||||
|
0, 0,0, 0,5, 12,-3,12,-3,.5,-10
|
||||||
|
0, 0,0, 0,5, -33.5,.5,-3,.5,-3
|
||||||
95
public/resource/mxcad/fonts/mxuser.pat
Normal file
95
public/resource/mxcad/fonts/mxuser.pat
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
*AR-B816, 8x16 块砖顺砌
|
||||||
|
0, 0,0, 0,8
|
||||||
|
90, 0,0, 8,8, 8,-8
|
||||||
|
*AR-B816C, 8x16 块砖顺砌,用灰泥接缝
|
||||||
|
0, 0,0, 8,8, 15.625,-.375
|
||||||
|
0, -8,.375, 8,8, 15.625,-.375
|
||||||
|
90, 0,0, 8,8, -8.375,7.625
|
||||||
|
90, -0.375,0, 8,8, -8.375,7.625
|
||||||
|
|
||||||
|
*AR-SAND, 随机的点图案
|
||||||
|
37.5, 0,0, 1.123,1.567, 0,-1.52,0,-1.7,0,-1.625
|
||||||
|
7.5, 0,0, 2.123,2.567, 0,-.82,0,-1.37,0,-.525
|
||||||
|
-32.5, -1.23,0, 2.6234,1.678, 0,-.5,0,-1.8,0,-2.35
|
||||||
|
-42.5, -1.23,0, 1.6234,2.678, 0,-.25,0,-1.18,0,-1.35
|
||||||
|
|
||||||
|
*BRASS, 黄铜制品
|
||||||
|
0, 0,0, 0,.25
|
||||||
|
0, 0,.125, 0,.25, .125,-.0625
|
||||||
|
|
||||||
|
*BRSTONE, 砖和石
|
||||||
|
0, 0,0, 0,.33
|
||||||
|
90, .9,0, .33,.5, .33,-.33
|
||||||
|
90, .8,0, .33,.5, .33,-.33
|
||||||
|
0, .9,.055, .5,.33, -.9, .1
|
||||||
|
0, .9,.11, .5,.33, -.9, .1
|
||||||
|
0, .9,.165, .5,.33, -.9, .1
|
||||||
|
0, .9,.22, .5,.33, -.9, .1
|
||||||
|
0, .9,.275, .5,.33, -.9, .1
|
||||||
|
*CLAY, 粘土材料
|
||||||
|
0, 0,0, 0,.1875
|
||||||
|
0, 0,.03125, 0,.1875
|
||||||
|
0, 0,.0625, 0,.1875
|
||||||
|
0, 0,.125, 0,.1875, .1875,-.125
|
||||||
|
|
||||||
|
*CROSS, 一系列十字形
|
||||||
|
0, 0,0, .25,.25, .125,-.375
|
||||||
|
90, .0625,-.0625, .25,.25, .125,-.375
|
||||||
|
*DASH, 划线
|
||||||
|
0, 0,0, .125,.125, .125,-.125
|
||||||
|
*DOLMIT, 地壳岩层
|
||||||
|
0, 0,0, 0,.25
|
||||||
|
45, 0,0, 0,.70710678, .35355339,-.70710768
|
||||||
|
*DOTS, 一系列点
|
||||||
|
0, 0,0, .03125,.0625, 0,-.0625
|
||||||
|
*EARTH, 地面
|
||||||
|
0, 0,0, .25,.25, .25,-.25
|
||||||
|
0, 0,.09375, .25,.25, .25,-.25
|
||||||
|
0, 0,.1875, .25,.25, .25,-.25
|
||||||
|
90, .03125,.21875, .25,.25, .25,-.25
|
||||||
|
90, .125,.21875, .25,.25, .25,-.25
|
||||||
|
90, .21875,.21875, .25,.25, .25,-.25
|
||||||
|
*ESCHER, Escher 图案
|
||||||
|
60, 0,0, -.6,1.039230484, 1.1,-.1
|
||||||
|
180, 0,0, -.6,1.039230484, 1.1,-.1
|
||||||
|
300, 0,0, .6,1.039230484, 1.1,-.1
|
||||||
|
60, .1,0, -.6,1.039230484, .2,-1
|
||||||
|
300, .1,0, .6,1.039230484, .2,-1
|
||||||
|
60, -.05,.08660254, -.6,1.039230484, .2,-1
|
||||||
|
180, -.05,.08660254, -.6,1.039230484, .2,-1
|
||||||
|
300, -.05,-.08660254, .6,1.039230484, .2,-1
|
||||||
|
180, -.05,-.08660254, -.6,1.039230484, .2,-1
|
||||||
|
60, -.4,0, -.6,1.039230484, .2,-1
|
||||||
|
300, -.4,0, .6,1.039230484, .2,-1
|
||||||
|
60, .2,-.346410161, -.6,1.039230484, .2,-1
|
||||||
|
180, .2,-.346410161, -.6,1.039230484, .2,-1
|
||||||
|
300, .2,.346410161, .6,1.039230484, .2,-1
|
||||||
|
180, .2,.346410161, -.6,1.039230484, .2,-1
|
||||||
|
0, .2,.173205081, -.6,1.039230484, .7,-.5
|
||||||
|
0, .2,-.173205081, -.6,1.039230484, .7,-.5
|
||||||
|
120, .05,.259807621, .6,1.039230484, .7,-.5
|
||||||
|
120, -.25,.08660254, .6,1.039230484, .7,-.5
|
||||||
|
240, -.25,-.08660254, .6,1.039230484, .7,-.5
|
||||||
|
240, .05,-.259807621, .6,1.039230484, .7,-.5
|
||||||
|
|
||||||
|
*GRASS, 草地
|
||||||
|
90, 0,0, .707106781,.707106781, .1875,-1.226713563
|
||||||
|
45, 0,0, 0,1, .1875,-.8125
|
||||||
|
135, 0,0, 0,1, .1875,-.8125
|
||||||
|
*GRATE, 格栅区域
|
||||||
|
0, 0,0, 0,.03125
|
||||||
|
90, 0,0, 0,.125
|
||||||
|
|
||||||
|
*HEX, 六边形
|
||||||
|
0, 0,0, 0,.216506351, .125,-.25
|
||||||
|
120, 0,0, 0,.216506351, .125,-.25
|
||||||
|
60, .125,0, 0,.216506351, .125,-.25
|
||||||
|
*HONEY, 蜂巢图案
|
||||||
|
0, 0,0, .1875,.108253175, .125,-.25
|
||||||
|
120, 0,0, .1875,.108253175, .125,-.25
|
||||||
|
60, 0,0, .1875,.108253175, -.25,.125
|
||||||
|
|
||||||
|
*INSUL, 绝缘材料
|
||||||
|
0, 0,0, 0,.375
|
||||||
|
0, 0,.125, 0,.375, .125,-.125
|
||||||
|
0, 0,.25, 0,.375, .125,-.125
|
||||||
BIN
public/resource/mxcad/fonts/stadobe.otf
Normal file
BIN
public/resource/mxcad/fonts/stadobe.otf
Normal file
Binary file not shown.
BIN
public/resource/mxcad/fonts/syadobe.otf
Normal file
BIN
public/resource/mxcad/fonts/syadobe.otf
Normal file
Binary file not shown.
BIN
public/resource/mxcad/fonts/txt.shx
Normal file
BIN
public/resource/mxcad/fonts/txt.shx
Normal file
Binary file not shown.
1999
public/resource/mxcad/wasm/2d-st/mxdrawassembly_min.js
Normal file
1999
public/resource/mxcad/wasm/2d-st/mxdrawassembly_min.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
public/resource/mxcad/wasm/2d-st/mxdrawassembly_minst.wasm
Normal file
BIN
public/resource/mxcad/wasm/2d-st/mxdrawassembly_minst.wasm
Normal file
Binary file not shown.
@ -107,7 +107,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import {generateMixed} from 'vue-kityminder-ggg/src/utils/index.js';
|
import {generateMixed} from 'vue-kityminder-ggg/src/utils/index.js';
|
||||||
import 'vue-kityminder-ggg/examples/styles/minder.css';
|
import 'vue-kityminder-ggg/examples/styles/minder.css';
|
||||||
import JSPDF from 'jspdf';
|
|
||||||
import api from "@/api/file-api";
|
import api from "@/api/file-api";
|
||||||
import txtApi from "@/api/markdown-api";
|
import txtApi from "@/api/markdown-api";
|
||||||
import historyApi from "@/api/file-history";
|
import historyApi from "@/api/file-history";
|
||||||
@ -324,26 +323,6 @@ export default {
|
|||||||
this.minder.execCommand(var1, var2)
|
this.minder.execCommand(var1, var2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
exportHandle(n, filename) {
|
|
||||||
filename = filename || (this.content.root.data.text || '无标题')
|
|
||||||
if (n === 0 || n === 'png') {
|
|
||||||
this.minder.exportData('png').then((content) => {
|
|
||||||
let element = document.createElement('a')
|
|
||||||
element.setAttribute('href', content)
|
|
||||||
element.setAttribute('download', filename)
|
|
||||||
element.style.display = 'none'
|
|
||||||
document.body.appendChild(element)
|
|
||||||
element.click()
|
|
||||||
document.body.removeChild(element)
|
|
||||||
})
|
|
||||||
} else if (n === 1 || n === 'pdf') {
|
|
||||||
this.minder.exportData('png').then((content) => {
|
|
||||||
let doc = new JSPDF()
|
|
||||||
doc.addImage(content, 'PNG', 0, 0, 0, 0)
|
|
||||||
doc.save(`${filename}.pdf`)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rendData() {
|
rendData() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@ -4329,7 +4329,7 @@ export default {
|
|||||||
this.openCompressionVisible = true
|
this.openCompressionVisible = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (row.contentType.indexOf('office') > -1 || ['pdf', 'csv', 'drawio', 'mind', 'glb', 'gltf'].includes(row.suffix)) {
|
if (row.contentType.indexOf('office') > -1 || suffix.iframePreviewFile.includes(row.suffix)) {
|
||||||
// iframe 预览
|
// iframe 预览
|
||||||
this.iframePreviewVisible = true
|
this.iframePreviewVisible = true
|
||||||
this.iframePreviewRow = row
|
this.iframePreviewRow = row
|
||||||
|
|||||||
88
src/components/preview/CADPreview.vue
Normal file
88
src/components/preview/CADPreview.vue
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="top-bar">
|
||||||
|
<div class="top-left"></div>
|
||||||
|
<div class="top-center">{{file.name}}</div>
|
||||||
|
<div class="top-right">
|
||||||
|
<div class="top-right-option">
|
||||||
|
<el-button title="切换背景色" size="medium" type="primary" @click="changeBackground" :icon="lightTheme?'el-icon-moon':'el-icon-sunny'"></el-button>
|
||||||
|
<el-button title="显示全部" size="medium" type="primary" @click="reset" icon="el-icon-c-scale-to-original"></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="iframe-content">
|
||||||
|
<canvas id="mxCadCanvas" style="height: 600px"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { createMxCad, MxCpp } from 'mxcad'
|
||||||
|
import { MxFun } from 'mxdraw'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CADPreview',
|
||||||
|
props: {
|
||||||
|
fileUrl: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
shareId: {
|
||||||
|
type: String,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
|
file: {
|
||||||
|
type: Object,
|
||||||
|
default: function() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
clientHeight: document.documentElement.clientHeight - 100,
|
||||||
|
lightTheme: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
mxwebUrl() {
|
||||||
|
if (this.shareId) {
|
||||||
|
return `${process.env.VUE_APP_BASE_API}/public/s/view/mxweb/${this.file.id}/${this.shareId}`
|
||||||
|
}
|
||||||
|
return `${process.env.VUE_APP_BASE_API}/view/mxweb/${this.file.id}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
createMxCad({
|
||||||
|
canvas: '#mxCadCanvas',
|
||||||
|
locateFile: (fileName) => window.location.origin + '/resource/mxcad/wasm/2d-st/' + fileName,
|
||||||
|
fontspath: window.location.origin + '/resource/mxcad/fonts/',
|
||||||
|
fileUrl: this.mxwebUrl,
|
||||||
|
}).then(() => {
|
||||||
|
MxFun.sendStringToExecute('Mx_Pan')
|
||||||
|
this.$emit('onReady')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeBackground() {
|
||||||
|
this.lightTheme = !this.lightTheme
|
||||||
|
const value = this.lightTheme ? 255 : 0
|
||||||
|
const mxcad = this.mxcad()
|
||||||
|
mxcad.updateDisplay()
|
||||||
|
mxcad.setViewBackgroundColor(value, value, value)
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
const mxcad = this.mxcad()
|
||||||
|
mxcad.regen()
|
||||||
|
mxcad.updateDisplay()
|
||||||
|
mxcad.zoomAll()
|
||||||
|
},
|
||||||
|
mxcad() {
|
||||||
|
return MxCpp.getCurrentMxCAD()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import 'src/styles/iframe.scss';
|
||||||
|
</style>
|
||||||
@ -170,6 +170,9 @@ export default {
|
|||||||
return ['docx', 'xlsx'].includes(this.file.suffix) && this.file.size > 0 && this.file.size < 1024 * 1024 * 5
|
return ['docx', 'xlsx'].includes(this.file.suffix) && this.file.size > 0 && this.file.size < 1024 * 1024 * 5
|
||||||
},
|
},
|
||||||
allowOpenFile() {
|
allowOpenFile() {
|
||||||
|
if (!this.file.contentType) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return (this.file.contentType.indexOf('office') > -1 || ['pdf', 'epub'].includes(this.file.suffix))
|
return (this.file.contentType.indexOf('office') > -1 || ['pdf', 'epub'].includes(this.file.suffix))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -102,62 +102,5 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.top-bar {
|
@import 'src/styles/iframe.scss';
|
||||||
width: 100%;
|
|
||||||
top: 0;
|
|
||||||
position: absolute;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.top-left {
|
|
||||||
width: 25%;
|
|
||||||
}
|
|
||||||
.top-center {
|
|
||||||
width: 50%;
|
|
||||||
text-align: center;
|
|
||||||
align-content: center;
|
|
||||||
}
|
|
||||||
.top-right {
|
|
||||||
width: 25%;
|
|
||||||
.svg-icon {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.top-right-option {
|
|
||||||
float: right;
|
|
||||||
margin-right: 3rem;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
height: 2.5rem;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
}
|
|
||||||
>>> .el-select {
|
|
||||||
width: 135px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.iframe-content {
|
|
||||||
position: absolute;
|
|
||||||
top: 2.5rem;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
display: -webkit-box;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
-webkit-box-align: center;
|
|
||||||
-ms-flex-align: center;
|
|
||||||
align-items: center;
|
|
||||||
-webkit-box-pack: center;
|
|
||||||
-ms-flex-pack: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #dcdfe6;
|
|
||||||
iframe {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
<svg-icon class="preview-close" icon-class="close"/>
|
<svg-icon class="preview-close" icon-class="close"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div>{{fileType}}</div>
|
<CADPreview v-if="fileType === 'cad'" :file="file" :shareId="shareId" :file-url="fileUrl" @onReady="onReady"></CADPreview>
|
||||||
<pdf-preview v-if="fileType === 'pdf'" :file="file" :shareId="shareId" :file-url="fileUrl" @onReady="onReady"></pdf-preview>
|
<pdf-preview v-else-if="fileType === 'pdf'" :file="file" :shareId="shareId" :file-url="fileUrl" @onReady="onReady"></pdf-preview>
|
||||||
<drawio v-else-if="fileType === 'drawio'" v-show="fileReday" :file="file" :shareId="shareId" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady" @onClose="close"></drawio>
|
<drawio v-else-if="fileType === 'drawio'" v-show="fileReday" :file="file" :shareId="shareId" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady" @onClose="close"></drawio>
|
||||||
<my-mind-editor v-else-if="fileType === 'mind'" :file="file" :shareId="shareId" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady" @onClose="close"></my-mind-editor>
|
<my-mind-editor v-else-if="fileType === 'mind'" :file="file" :shareId="shareId" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady" @onClose="close"></my-mind-editor>
|
||||||
<model-preview v-else-if="fileType === 'glTF/GLB'" :file="file" :file-url="fileUrl" :shareId="shareId" @onReady="onReady"></model-preview>
|
<model-preview v-else-if="fileType === 'glTF/GLB'" :file="file" :file-url="fileUrl" :shareId="shareId" @onReady="onReady"></model-preview>
|
||||||
@ -38,11 +38,13 @@ import IframeContentPreview from '@/components/preview/IframeContentPreview.vue'
|
|||||||
import fileConfig from "@/utils/file-config";
|
import fileConfig from "@/utils/file-config";
|
||||||
import PdfPreview from "@/components/office/PdfPreview";
|
import PdfPreview from "@/components/office/PdfPreview";
|
||||||
import Drawio from "@/components/office/Drawio";
|
import Drawio from "@/components/office/Drawio";
|
||||||
import MyMindEditor from "@/components/Minder/minder"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'IframePreview',
|
name: 'IframePreview',
|
||||||
components: { IframeContentPreview, ModelPreview, Drawio, PdfPreview, MessageDialog, OnlyOfficeEditor, MyMindEditor},
|
components: { IframeContentPreview, ModelPreview, Drawio, PdfPreview, MessageDialog, OnlyOfficeEditor,
|
||||||
|
MyMindEditor: () => import('@/components/Minder/minder'),
|
||||||
|
CADPreview: () => import('@/components/preview/CADPreview.vue')
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -146,6 +148,8 @@ export default {
|
|||||||
case 'office':
|
case 'office':
|
||||||
case 'csv':
|
case 'csv':
|
||||||
return 'office'
|
return 'office'
|
||||||
|
case 'dwg':
|
||||||
|
return 'cad'
|
||||||
default:
|
default:
|
||||||
return 'other'
|
return 'other'
|
||||||
}
|
}
|
||||||
|
|||||||
60
src/styles/iframe.scss
Normal file
60
src/styles/iframe.scss
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
.top-bar {
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 99;
|
||||||
|
box-shadow: 0 1px 5px 0 #e9e9e994;
|
||||||
|
}
|
||||||
|
.top-left {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
.top-center {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
.top-right {
|
||||||
|
width: 25%;
|
||||||
|
.svg-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.top-right-option {
|
||||||
|
float: right;
|
||||||
|
margin-right: 3rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
height: 2.5rem;
|
||||||
|
line-height: 2.5rem;
|
||||||
|
}
|
||||||
|
>>> .el-select {
|
||||||
|
width: 135px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.iframe-content {
|
||||||
|
position: absolute;
|
||||||
|
top: 2.5rem;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
-webkit-box-pack: center;
|
||||||
|
-ms-flex-pack: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #dcdfe6;
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,6 +10,7 @@ export const suffix = {
|
|||||||
compressedFile: [
|
compressedFile: [
|
||||||
'zip','tar','7z', 'rar', 'jar','tar.gz','tgz','tar.bz2'
|
'zip','tar','7z', 'rar', 'jar','tar.gz','tgz','tar.bz2'
|
||||||
],
|
],
|
||||||
|
iframePreviewFile: ['pdf', 'csv', 'drawio', 'mind', 'glb', 'gltf', 'dwg']
|
||||||
}
|
}
|
||||||
|
|
||||||
monaco.languages.getLanguages().forEach(language => {
|
monaco.languages.getLanguages().forEach(language => {
|
||||||
|
|||||||
@ -1090,7 +1090,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// office文件
|
// office文件
|
||||||
if (row.contentType.indexOf('office') > -1 || ['pdf', 'csv', 'drawio', 'mind'].includes(row.suffix)) {
|
if (row.contentType.indexOf('office') > -1 || suffix.iframePreviewFile.includes(row.suffix)) {
|
||||||
// office文件
|
// office文件
|
||||||
this.officePreviewVisible = true
|
this.officePreviewVisible = true
|
||||||
this.officePreviewRow = row
|
this.officePreviewRow = row
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user