File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -223,12 +223,14 @@ window.ComponentDot = class {
223
223
e . preventDefault ( ) ;
224
224
} ) ;
225
225
this . menu = Object . assign ( { mode : false , placeholder : '未选择' , height : '150px' } , menu ) ;
226
-
226
+ selected = selected . filter ( d => {
227
+ if ( select [ d ] === undefined ) return false ;
228
+ return true ;
229
+ } ) ;
227
230
this . selected_data = selected ;
228
231
this . select_data = [ ] ;
229
232
this . insert_data = [ ] ;
230
233
this . delete_data = [ ] ;
231
-
232
234
setTimeout ( ( ) => {
233
235
let queue = [ ] ;
234
236
this . CONTENT_DOM . childNodes . forEach ( ( D ) => {
@@ -260,6 +262,7 @@ window.ComponentDot = class {
260
262
if ( ! select . hasOwnProperty ( i ) ) continue ;
261
263
select_dom += `<div class="dlp dlp-label dlp-text" data-id="${ i } " title="${ select [ i ] } "><span>${ select [ i ] } </span></div>` ;
262
264
}
265
+
263
266
let html = `<div class="dlp dlp-dot" ><div class="dot-top"><input type="text" class="dlp dot-search" placeholder="搜索名称"><div class="dot-selected dlp-scroll"></div></div><div class="dot-body"><div class="dot-select dlp-scroll">${ select_dom } </div></div></div>
264
267
<input name="${ this . name } [select]" value='${ JSON . stringify ( selected ) } ' type="hidden"><input name="${ this . name } [insert]" value="[]" type="hidden"><input name="${ this . name } [delete]" value="[]" type="hidden">` ;
265
268
this . DOM . insertAdjacentHTML ( 'afterbegin' , html ) ;
@@ -485,6 +488,10 @@ window.ComponentCascadeDot = class {
485
488
console . error ( 'CascadeDot param selected and select must be array!' ) ;
486
489
return ;
487
490
}
491
+ selected = selected . filter ( d => {
492
+ if ( select [ d ] === undefined ) return false ;
493
+ return true ;
494
+ } ) ;
488
495
this . name = name ;
489
496
this . limit = limit ;
490
497
this . DOM = document . getElementById ( name ) ;
You can’t perform that action at this time.
0 commit comments