|
动态生成组件 justep.Bind.addNodes(parentNode, $(attachDiv ));
var idRandom = justep.UUID.createUUID();
var attachDiv = '';
attachDiv += '<div component="$model/UI2/system/components/justep/attachment/attachmentSimple" xid="attachmentSimple'
+ p.attr_name + '" ';
attachDiv += 'data-bind="component:{ref:$model.'+dataName+'.ref("'+p.attr_name+'"),name:\'$model/UI2/system/components/justep/attachment/attachmentSimple\'}" ';
attachDiv += 'data-config="{"actionUrl":"http://***/mobileFileUpload"}" ';
attachDiv += 'id="'
+ idRandom
+ '_attachmentSimple'
+ p.attr_name
+ '" actionurl="http://***/mobileFileUpload">';
attachDiv += '<div class="x-attachment" xid="'
+ p.attr_name + 'div4" id="' + idRandom + '_'
+ p.attr_name + 'div4"> ';
attachDiv += '<div class="x-attachment-content x-card-border" xid="'
+ p.attr_name
+ 'div5" id="'
+ idRandom
+ '_'
+ p.attr_name + 'div5"> ';
attachDiv += '<div class="x-doc-process" xid="'
+ p.attr_name + 'div6" id="' + idRandom + '_'
+ p.attr_name + 'div6"> ';
attachDiv += '<div class="progress-bar x-doc-process-bar" role="progressbar" style="width:0%;" xid="progressBar'
+ p.attr_name
+ '" id="'
+ idRandom
+ '_progressBar' + p.attr_name + '"></div>';
attachDiv += '</div> ';
attachDiv += '<div data-bind="foreach:$attachmentItems" xid="'
+ p.attr_name
+ 'div7" id="'
+ idRandom
+ '_'
+ p.attr_name
+ 'div7" __component-context__="inline"></div> ';
attachDiv += '<div class="x-attachment-cell" data-bind="visible:$state.get() == \'upload\'" xid="'
+ p.attr_name
+ 'div10" id="'
+ idRandom
+ '_'
+ p.attr_name + 'div10"> ';
attachDiv += '<div class="x-attachment-item x-item-upload" data-bind="visible:$state.get() == \'upload\'" xid="'
+ p.attr_name + 'div11" ';
attachDiv += 'id="' + idRandom + '_' + p.attr_name
+ 'div11" style="position: relative;">';
// attachDiv += '<form style="position: absolute; top: -3px; right: -3px; bottom: -3px; left: -3px; display: none;" >';
// attachDiv += '<input type="file" name="userfile" accept="*/*" tabindex="-1" style="cursor: pointer; opacity: 0; position: relative; z-index: 999; width: 100%; height: 100%; overflow: hidden; display: none;" >';
// attachDiv += '</form><span style="display:none"></span>';
attachDiv += '</div></div> ';
attachDiv += '<div class="x-attachment-cell" data-bind="visible:$state.get() == \'upload\' && $attachmentItems.get().length > 0" xid="'
+ p.attr_name
+ 'div12" id="'
+ idRandom
+ '_'
+ p.attr_name + 'div12" style="display: none;"> ';
attachDiv += '<div class="x-attachment-item x-item-remove" data-bind="click:changeState.bind($object,\'remove\')" xid="'
+ p.attr_name
+ 'div13" id="'
+ idRandom
+ '_'
+ p.attr_name + 'div13"></div>';
attachDiv += '</div><div style="clear:both;" xid="'
+ p.attr_name + 'div14" id="' + idRandom + '_'
+ p.attr_name
+ 'div14"></div></div></div></div>';
这样添加的上传文件组件。不好用。谁有好的解决办法 |
|