File tree Expand file tree Collapse file tree 6 files changed +41
-11
lines changed
src/main/resources/web/assets Expand file tree Collapse file tree 6 files changed +41
-11
lines changed Original file line number Diff line number Diff line change @@ -4378,6 +4378,7 @@ h3.modal-title > .rbv {
4378
4378
.editor-preview img {
4379
4379
max-width : 100% !important ;
4380
4380
max-height : 100% !important ;
4381
+ cursor : zoom-in;
4381
4382
}
4382
4383
4383
4384
.mdedit-content th ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
21
21
bottom : 0 ;
22
22
left : 0 ;
23
23
width : 100% ;
24
+ z-index : 1 ;
24
25
}
25
26
26
27
.task-form .form-group .row {
Original file line number Diff line number Diff line change @@ -376,12 +376,14 @@ const ECHART_AXIS_LABEL = {
376
376
} ,
377
377
}
378
378
379
- const ECHART_MARK_LINE = {
380
- data : [ { type : 'average' , name : $L ( '均线' ) } ] ,
381
- symbol : 'none' ,
382
- silent : true ,
383
- emphasis : { disabled : true } ,
384
- label : { show : false } ,
379
+ const ECHART_MARK_LINE2 = function ( showLabel = false ) {
380
+ return {
381
+ data : [ { type : 'average' , name : $L ( '均线' ) } ] ,
382
+ symbol : 'none' ,
383
+ silent : true ,
384
+ emphasis : { disabled : true } ,
385
+ label : { show : showLabel } ,
386
+ }
385
387
}
386
388
387
389
const ECHART_VALUE_LABEL2 = function ( dataFlags = [ ] ) {
@@ -541,7 +543,7 @@ class ChartLine extends BaseChart {
541
543
if ( showAreaColor ) yAxis . areaStyle = { opacity : 0.2 }
542
544
if ( showNumerical ) yAxis . label = ECHART_VALUE_LABEL2 ( dataFlags )
543
545
yAxis . cursor = 'default'
544
- if ( showMarkLine ) yAxis . markLine = { ... $clone ( ECHART_MARK_LINE ) }
546
+ if ( showMarkLine ) yAxis . markLine = ECHART_MARK_LINE2 ( showNumerical )
545
547
data . yyyAxis [ i ] = yAxis
546
548
}
547
549
@@ -614,7 +616,7 @@ class ChartBar extends BaseChart {
614
616
yAxis . smooth = true
615
617
yAxis . lineStyle = { width : 3 }
616
618
}
617
- if ( showMarkLine ) yAxis . markLine = { ... $clone ( ECHART_MARK_LINE ) }
619
+ if ( showMarkLine ) yAxis . markLine = ECHART_MARK_LINE2 ( showNumerical )
618
620
data . yyyAxis [ i ] = yAxis
619
621
}
620
622
Original file line number Diff line number Diff line change @@ -1498,7 +1498,7 @@ class RbFormNText extends RbFormElement {
1498
1498
$createUploader ( this . _fieldValue__upload , null , ( res ) => {
1499
1499
const pos = mde . codemirror . getCursor ( )
1500
1500
mde . codemirror . setSelection ( pos , pos )
1501
- mde . codemirror . replaceSelection ( `` )
1501
+ mde . codemirror . replaceSelection ( `` )
1502
1502
_mdeFocus ( )
1503
1503
} )
1504
1504
if ( this . props . onView ) _mdeFocus ( )
@@ -1807,6 +1807,7 @@ class RbFormImage extends RbFormElement {
1807
1807
}
1808
1808
}
1809
1809
}
1810
+
1810
1811
removeItem ( item , e ) {
1811
1812
e && $stopEvent ( e , true )
1812
1813
const paths = this . state . value || [ ]
Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ class ValueDescription extends ValueComp {
413
413
return (
414
414
< div className = "form-control-plaintext" ref = { ( c ) => ( this . _$mde = c ) } >
415
415
< textarea defaultValue = { this . state . description || '' } ref = { ( c ) => ( this . _$editor = c ) } />
416
- < input type = "file" className = "hide" accept = "image/*" ref = { ( c ) => ( this . _fieldValue__upload = c ) } />
416
+ < input type = "file" className = "hide" accept = "image/*" data-noname = "true" ref = { ( c ) => ( this . _fieldValue__upload = c ) } />
417
417
< div className = "mt-2 text-right" >
418
418
< button onClick = { ( ) => this . _handleEditMode ( false ) } className = "btn btn-sm btn-link mr-1" >
419
419
{ $L ( '取消' ) }
@@ -496,6 +496,16 @@ class ValueDescription extends ValueComp {
496
496
} )
497
497
mde . codemirror . focus ( )
498
498
mde . codemirror . setCursor ( mde . codemirror . lineCount ( ) , 0 ) // cursor at end
499
+
500
+ // v4.0
501
+ mde . codemirror . on ( 'paste' , ( _mde , e ) => {
502
+ const data = e . clipboardData || window . clipboardData
503
+ if ( data && data . items && data . files && data . files . length > 0 ) {
504
+ $stopEvent ( e , true )
505
+ this . _fieldValue__upload . files = data . files
506
+ $ ( this . _fieldValue__upload ) . trigger ( 'change' )
507
+ }
508
+ } )
499
509
}
500
510
} )
501
511
}
Original file line number Diff line number Diff line change @@ -1135,7 +1135,22 @@ class Md2Html extends React.Component {
1135
1135
$stopEvent ( e , false )
1136
1136
} )
1137
1137
} )
1138
- // TODO 图片预览
1138
+
1139
+ // 图片预览
1140
+ let imgs = [ ]
1141
+ $ ( this . _$md2html )
1142
+ . find ( 'img[src]' )
1143
+ . each ( function ( ) {
1144
+ const $img = $ ( this )
1145
+ let isrc = $img . attr ( 'src' )
1146
+ isrc = isrc . split ( '/filex/img/' ) [ 1 ] . split ( / [ ? & ] i m a g e V i e w 2 / ) [ 0 ]
1147
+ imgs . push ( isrc )
1148
+ $img . on ( 'click' , ( e ) => {
1149
+ $stopEvent ( e , true )
1150
+ const p = parent || window
1151
+ p . RbPreview . create ( imgs , imgs . indexOf ( isrc ) || 0 )
1152
+ } )
1153
+ } )
1139
1154
} )
1140
1155
}
1141
1156
}
You can’t perform that action at this time.
0 commit comments