File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -223,12 +223,14 @@ window.ComponentDot = class {
223223 e . preventDefault ( ) ;
224224 } ) ;
225225 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+ } ) ;
227230 this . selected_data = selected ;
228231 this . select_data = [ ] ;
229232 this . insert_data = [ ] ;
230233 this . delete_data = [ ] ;
231-
232234 setTimeout ( ( ) => {
233235 let queue = [ ] ;
234236 this . CONTENT_DOM . childNodes . forEach ( ( D ) => {
@@ -260,6 +262,7 @@ window.ComponentDot = class {
260262 if ( ! select . hasOwnProperty ( i ) ) continue ;
261263 select_dom += `<div class="dlp dlp-label dlp-text" data-id="${ i } " title="${ select [ i ] } "><span>${ select [ i ] } </span></div>` ;
262264 }
265+
263266 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>
264267<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">` ;
265268 this . DOM . insertAdjacentHTML ( 'afterbegin' , html ) ;
@@ -485,6 +488,10 @@ window.ComponentCascadeDot = class {
485488 console . error ( 'CascadeDot param selected and select must be array!' ) ;
486489 return ;
487490 }
491+ selected = selected . filter ( d => {
492+ if ( select [ d ] === undefined ) return false ;
493+ return true ;
494+ } ) ;
488495 this . name = name ;
489496 this . limit = limit ;
490497 this . DOM = document . getElementById ( name ) ;
You can’t perform that action at this time.
0 commit comments