From e58f0cc3761c9cac65a3098feec5d30abb47cd4f Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 8 Aug 2023 16:26:04 +0800 Subject: [PATCH] =?UTF-8?q?vscode=E5=9B=BA=E5=AE=9A=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/system/19/bg1.png | Bin 0 -> 1895 bytes src/assets/images/system/19/btn.png | Bin 0 -> 1329 bytes src/assets/images/system/19/header.png | Bin 0 -> 1579 bytes src/assets/images/system/19/left.png | Bin 0 -> 2511 bytes src/assets/images/system/19/right.png | Bin 0 -> 2539 bytes src/assets/images/system/19/yes.png | Bin 0 -> 333 bytes src/components/codemirror.vue | 5 +++-- src/config/index.js | 5 +++-- src/main.js | 2 ++ src/util/index.js | 24 ++++++++++++++++++++++++ 10 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 src/assets/images/system/19/bg1.png create mode 100644 src/assets/images/system/19/btn.png create mode 100644 src/assets/images/system/19/header.png create mode 100644 src/assets/images/system/19/left.png create mode 100644 src/assets/images/system/19/right.png create mode 100644 src/assets/images/system/19/yes.png diff --git a/src/assets/images/system/19/bg1.png b/src/assets/images/system/19/bg1.png new file mode 100644 index 0000000000000000000000000000000000000000..15baff46e63b19e04920e3e0ca7b343741ef0944 GIT binary patch literal 1895 zcmbVLdpOg382|k?V@Jria6KJ<;}0uou$lz7`opgS z;XxAIPK7HO@Bj%O@PmhZ=OXW@aK(POGI)+w5j>Zj^(*$v7)!XbisoFh4+S910tI50 zFJ58|Ew^>XJD65_gES-(xGlb&!ZE!z!H0&D?}V4*=WxwjK;9&zsW z(OMK83$&SQ%)B7jaxx10joAY$(S<*bXVPof&5MwJ0Q(p}g^i%sS(m}YHTtcWbN@uD zDmJNFvi3srsz@fW=t#y1O2Z}6kI%pex%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diff --git a/src/assets/images/system/19/btn.png b/src/assets/images/system/19/btn.png new file mode 100644 index 0000000000000000000000000000000000000000..102a579cbbf995ea1600756834a67acbbe5beef9 GIT binary patch literal 1329 zcmV-11oiO`l?|3!dU;sTK{2H|HxDMt6=@ZS@^18 z{li)Ls$l%XS^sHK{KHuJt6=%6VEw~c{li%Kt6=|VQvbqN|HNAVYEb`ZQ2%6C{li)R zzF7bN|M{z6|7lYHoLB#aSO0HU|F~EGkyrnFSO5I={l;Vei&y`3R{hR+|EO30^x*!d zSpMa<|A1Eh;jI1Ejs41P|FT#AX;%Hxg8%sI|Ln{Cxmo^%SpT9||CU$&*_Zx~SpTh8 z|7TbK@Yeq6!T#N%{k2&Au~_}ASpRHS`kG$-lv)0MS^l0_|8`jUq+b2HV*Z#|=}WRR z0000pbW%=J073rGfFKa)xUir<@W82tOAQ3@@8ICipqy}UU|=vR67S&O)zHAev#_s_ zfPY|5N-!Y7aVxz500VVNL_t(o!^N0qQ`&2avbrV9a>v*PY#=}= zN&f#o$etIH$Rv|5KKYrkPWp7u?7mvxNCnq=!8PhlodGgh=T+o~z(|}{#DDC@>3r1PDtRCO}T_d)U8Pvca`xbZQ z9~!ZTXx9SYZXr5gj-h2)yFi@OU<=!YAP4{=vmSevwNDFcoGaeRXe4MuoFbxE0|z~W z0qI$m1DcUV@%o<{E_!X(LocD01YnbsF^1p19Rfibr;5emsXsMVX=5J;Z6JjfNnsm| zBi@t6xlA?^3?Si1v}j4N2F59n#o25`Tj-8d2nYM%qYoz7-AlW;ZS&wbTP)7bXEhK3 z`dp0&6H^*JluXxeQ#H<$MOI@#U8td#+S>Y zl$J}9Ntebo0stF52jakuJzUjK5loyfw0B)8Rh7)eF^vc#y)(9K-}Z0-(Du*;V&W}n zsEx*oDwnw=AF>+pXnNOLsIl96iX<>`y0mdvk#bpuN`+;5dOFq=2T?~ii2Nu9ZGkaN znjY<2R%=pLRk*gS>XP`F)zBWE4@}U~F_}0iZM&wLQg$jOYEFaGG55rJbm7A5cXLPo zDSZ;Logna2#6b*`M~{rnkS>*`Y=&XIPVu-R?pn+Rt)U4LWT-3#*q20SMZdDTFT^I@ zFU~zP&?OVm zJlN4i=*VN1D>|evbJs|z2EXQKsj4~+S{FWj&c7OU)ntoCsH(az7YlUw%2#8X-qKAj z#fqwoGIC>49|Erz^3*`N5jIDu==Mv~bDhCe!Gxda9|)F)vF z0=-BZesM~i;K8kHV2DGMnstC^TOPm>*KR!!xpH4JH^p?hCz&^5y4+-q=VHp-mYTO> n+AKV#L-?GSKKE|i7yscW(jxB}w0qIv00000NkvXXu0mjfT{NQA literal 0 HcmV?d00001 diff --git a/src/assets/images/system/19/header.png b/src/assets/images/system/19/header.png new file mode 100644 index 0000000000000000000000000000000000000000..c1150c729f593605165d7f5e8c2683771ade9485 GIT binary patch literal 1579 zcmV+`2Gse9P)H`Kn<2!&v`lQT@YM{lZxN!&v>oSpR8J|7cPDc~}2rSN+3T z|GrrN|Nr@`VE<`S|7lkLxL5zDSO0rg|A1Eh;jI6%SO0ET{l;Vei&p=lSO1+?{nCQ{ z%5D9;SpTh8|Aklo@Yeq6!T#Bo|CU()`}F>ZSpS+=|8-XX^x*y0js3V-|8Q6R&UpTh zS^xa?|B+Y!c~}4V>;0`*{^hp*-J<=pSpRlc|Ln{Ce_H=#RR3pE|M=?qo?iX1SpIle zS19fq0000YbW%=J0GWUg(IMdQz@U-_Xs#znBw{d|Utk z1h7d&K~#9!?c2vz8!;4sVFd#rg!JB%E6JYbHtro`W77j^y#Jd-S7OEupJXXK#*8@U+0#di+$B%4*|+Q;UThGDJkDmb-;ysc*e$j;fw*L%lJ+67xy6=cwt+b1 zS|$ArsqG9~vJ1p5UREhWYL_jcN$Q-gN_qvUZMNh!5XW3CK6zg=mf3iiVJRT4DP|Q9 zQY^EX%RQi^F8i&LUPFq#&*gIWDXGh@7H8>$T#ja`>#q89MSoz?Oz-!b=L8u62ybqgZHN?N=aQ6UGN*H{aMoIjFLLai}{??jDu*fmp~BTse>}6ISMH zrQyxv_f%DUnl&EpJewu;jtatvLm;;4bCj2PHFl)zsIWbG$hAj|?POCglcbR^M5A0j zsx(y80T9asH%sY(4%<=VCC*sw1HP`E+GC(Kg$TlAy86`AI(3euEUEF#bd|&2uMSt< z;g2ew?CiYNk6vbyhC);TU_WXe;~#2jn~&S!TFHQ73-mfG@Meg4Q6nMvw<;5CGZj{<=;%c20pA~8poxRe@)=d>cq-qM zQ?s%TGP@5mOGzUU&t@qm4RJ9o0Sg;k&zF-H)EJ9_Zfa@< zbd0fyKDNvzX)ioOt{4A9hp8-nid?J-vAhUua7a42W1Y9D_< zp>513Eel*e_ha9Wz$>WFw3gbXi4*gr#I*jUvlWp7DJH;&9!}@dFdu%#Du37gUt^80M`eRiXm!j*6go5&nXQkP8r zrzs_MN`rhe$g{PzMu-0nQ dd&G5Y(O-@VV62D64I2Oe002ovPDHLkV1h*}BijG~ literal 0 HcmV?d00001 diff --git a/src/assets/images/system/19/left.png b/src/assets/images/system/19/left.png new file mode 100644 index 0000000000000000000000000000000000000000..06092c3f4102050ded632757b353ba6f6f3a20ad GIT binary patch literal 2511 zcmXw4c{CK<8y+bl$-eYa@y*y}Cu_C|S;xrCSTYR8l5E*ab}7$S;E|Jbk6Ubd*Aym&vT#mJ@=2BVq;};lKnJ01Oho}W@>E9I5io&<2WB^z)_99oa z#2jY45r@_b@pst*FB^cf->t^(*SY}w-=wD;dj?+s%KQi9rE(6sZ5J(uD@)hur-x3`n;FS+<}D4f-9ysPiEPfI|t!q-$Tm)HrCa z2i{1q^&1rDFuDR8>mWT5?EL|>1wfqv&xwH43ZhV8m<;;64|;Kc@K?PA1!6)$J_`7w z!2WMgjsi(2u(AYxEgTGmGo}E~QJ?_@)~D!;&%hd)zVwnlTY4}ScQEJ&cD{m!YEV&p zFqH=UTtOHL%uIr}B+&YjK9da!v%tMrkj=Q?9z03~Vb{Ptd$99`zS>DoLxZH7AjF%V ziK>m0r7&I*dBfHU2}up+(qAVj&g%!nl$^7v!=5S}a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jF|YJQ+uN-NN?;vr}T z3OkxsrCm4oXu9=2OV2fL-&%mp41VfE6s#|3d0M>A2X45zIF^{nQ2-O4`N!#_#(_@m zck`}C>Zs&F6$-qN+sOv?@df^5K>@ zax}LoDFcia_$JG)*V}r8Xfo{ID zl3*`%XbV`sEvCKSke*qlos_yk)^mOadqkZt>TBnXCS;vUeExjEr))#W=xKI^i@e)1 zR|laov^`_SDDvhdF=5B(cPS#QuaNy!KF-`rmG|S7rJxQn4N_!v-TIye33GFkqlK}$ z{bjhleFbTKb9PL8Sz`y4HM{z2R@V2a%;K#3Ocw+)BCYOid}K51y}Wwu%vi<@N@hT^ z_|g((Ye8A$>KXil!QPw1@$C&?PlAQ-ES_ti zj{CZ*v|w!h{7`y!$goCi{?$64x$+Q!{-LJ{-cdvGPJdb> z^^>!@P$Ep&t;1NXmip6-v#il{K42hmKS;|%?fjbIeTx^L#7M6B#0}YzbRA7xai?TJ zZy3?&z7DQb>qzo&^I`(QT4||Y7=Jq6Tu5bcut-z|N<#LIoXpv6s09OiK@{07yR+*e zd%9N#H@U5sGjUpM_gCR}O&EVV#0+j_Tw{oh`wsv^ B6TScd literal 0 HcmV?d00001 diff --git a/src/assets/images/system/19/right.png b/src/assets/images/system/19/right.png new file mode 100644 index 0000000000000000000000000000000000000000..d4ab205bef39b113d636f24c2a75842a334865d7 GIT binary patch literal 2539 zcmX|Cc{tSD8z0x8+%&SKQdgl+H%o=?wTA55nC3f^ZR|@S8HpIOyJO$Cgk%|}EM+XA z%(%!d5sfu;ZCS&lnRCbeJS!{vYQ* z$jt({TO5RrXhsDNxFLb71z;y#P{7p^xFGi{aLjtlL7q)>LNiD>CKbC!!m%MXpGn2+ zms$U$VSlh|U!j4AIe3W!jwle$wrDoW<{yyjA$Aq0MKfD5%okP%T{)uvM_|#QpA;+5 zfdM_%;28w`(9AY0h-ae^pgOV-@)E8SRY}{RDzXm)_fgnqKG*Z#(eJy z+TVgF>CBOM@c02JgFptviiSWWyQ%_|6|lxKL4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>fRU{(B8G}s?KA)KJ>~XIVq?fe^yG{F;;(vdvuRa15vV{a_@QX$C)BOdd3N;PthlO zJa|lPb#Uu0SA%WreQy3(lQ404Ey6FxM1!?!CZW7<1MQaNearLt(+vyEzG>UMh!|Oj zaC_Z1j4-xvZ?!y@Dl^m7vPyUzG_7yE=_JfnI3JDzwt>-llm;rt%3C=GO?glN*ucaRN=9q%OP;d$>htyFUa_;^lkt$qh-rBH zZ7vjw=3xGpr(IoYss)L!r@H9|(8WtWb-mnGxxg%^W-bRa-mR@x)lhuQNbbRJkcBh>+`kvx&eJC(?&L72=m&4_xeadiZRr@yKEGbmuWc zg@P`0%kBJ+bq(zejkeQr2 z23EU0V=m>s%8Hfwy`Ws(RNTtqv6OXwv7n;iRqXu;)6=K-W~~#SL88zeut^lK=n! literal 0 HcmV?d00001 diff --git a/src/assets/images/system/19/yes.png b/src/assets/images/system/19/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..3985785a40cb07db9736a65e9f8518834897becf GIT binary patch literal 333 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_>3?$zOPHh5GDgizru0Z;KO89>uxOweYTGZ{1 zw!6y~z06DhoEiT%JLOw??CZSrL`jEjKy{2IL4Lsu4$p3+0Xf$_T^vI!PS3sK$k${b zz#6c_QN3Zs>9U7WW@_&)#4WgYq=4xQOBI{`1Kzbl%isFU*0NV*jI&eBv_8t;sM)kn zpYgDQ;{*4C2O&(Ht9J;6MQk|a9g%pFSxd3Q%&e1I>X2#8{mLhN-L<`Ya~it3CmZRx23@KyIoIbue}0H&wO^&CIlo2cojVVw c%+1%I@iFAjw=EMhfL>(qboFyt=akR{04K$XQUCw| literal 0 HcmV?d00001 diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 3dd26f0..22f55ea 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -562,7 +562,8 @@ export default { }, // 下载图片 downloadPic (i) { - this.$refs['picLink' + i][0].click() + util.downloadPic('运行结果.png', this.picSrcList[i]) + // this.$refs['picLink' + i][0].click() }, // 导出运行结果 exportResult () { @@ -572,7 +573,7 @@ export default { // }) var FileSaver = require('file-saver'); var blob = new Blob([str], { type: "text/plain;charset=utf-8" }); - FileSaver.saveAs(blob, 'result.docx') + FileSaver.saveAs(blob, 'result.csv') }, // 获取正式答案 getTips () { diff --git a/src/config/index.js b/src/config/index.js index 1e7ceee..c9cb09b 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development' //是否本地 const isHh = url.includes('10.196.131.73') //是否是河海版本 const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 -let vscodeUrl = 'http://121.37.12.51:8088/?folder=/home/coder' +let vscodeUrl = 'http://121.37.12.51:8088' let host = location.origin + '/' let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 @@ -18,10 +18,11 @@ if (isDev) { } else if (isPro) { host = 'https://occupationlab.com/' bankPath = `https://www.huorantech.cn/banksystem` - vscodeUrl = 'https://vscode.occupationlab.com/' + vscodeUrl = 'https://vscode.occupationlab.com' } else if (isZxy) { vscodeUrl = 'https://vscode.izhixinyun.com' } +vscodeUrl += `?folder=/home/coder/workspace` const systemId = Cookie.get('admin-systemId') export default { /** diff --git a/src/main.js b/src/main.js index c8b564e..556c132 100644 --- a/src/main.js +++ b/src/main.js @@ -37,6 +37,8 @@ if (systemId.includes(',')) { import('@/styles/theme/theme10.scss') } else if (systemId == 18) { import('@/styles/theme/theme10.scss') + } else if (systemId == 19) { + import('@/styles/theme/theme10.scss') } } import api from './api'; diff --git a/src/util/index.js b/src/util/index.js index d28a1eb..3b1f7b5 100644 --- a/src/util/index.js +++ b/src/util/index.js @@ -68,6 +68,30 @@ export default { } x.send() }, + // 下载图片 + downloadPic(fileName, src) { + const canvas = document.createElement('canvas') + const img = document.createElement('img') + // 解决跨域 Canvas 污染问题 + img.setAttribute('crossOrigin', 'anonymous') + //将资源链接赋值过去,才能触发img.onload事件 + img.src = src + img.onload = function (e) { + canvas.width = img.width + canvas.height = img.height + const context = canvas.getContext('2d') + //绘制图片 + context.drawImage(img, 0, 0, img.width, img.height) + canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height) + //将canvas转base64码,然后创建一个a连接自动下载图片 + canvas.toBlob((blob) => { + const link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = fileName + link.click() + }) + } + }, // 传入文件名和数据,下载文件 downloadFileDirect(fileName,data) { if ('download' in document.createElement('a')) { // 非IE下载