fastadmin 附件

1 mysql

 

 

2 js

{field: 'attachfile', title: __('Attachfile'),formatter:Table.api.formatter.url}

3 add.html

<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
    <div class="col-xs-12 col-sm-8">
        <div class="input-group">
            <input id="c-attachfile" data-rule="required" class="form-control" size="50" name="row[attachfile]" type="text" value="">
            <div class="input-group-addon no-border no-padding">
                <span><button type="button" id="plupload-attachfile" class="btn btn-danger plupload" data-input-id="c-attachfile" data-multiple="false" data-preview-id="p-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-attachfile" class="btn btn-primary fachoose" data-input-id="c-attachfile" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            </div>
            <span class="msg-box n-right" for="c-attachfile"></span>
        </div>
        <ul class="row list-inline plupload-preview" id="p-attachfile"></ul>
    </div>
</div>

4 edit.html

<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
    <div class="col-xs-12 col-sm-8">
        <div class="input-group">
            <input id="c-attachfile" data-rule="required" class="form-control" size="50" name="row[attachfile]" type="text" value="{$row.attachfile|htmlentities}">
            <div class="input-group-addon no-border no-padding">
                <span><button type="button" id="plupload-attachfile" class="btn btn-danger plupload" data-input-id="c-attachfile" data-multiple="false" data-preview-id="p-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-attachfile" class="btn btn-primary fachoose" data-input-id="c-attachfile" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            </div>
            <span class="msg-box n-right" for="c-attachfile"></span>
        </div>
        <ul class="row list-inline plupload-preview" id="p-attachfile"></ul>
    </div>
</div>

 

posted @ 2020-07-13 15:07  CanyingV  阅读(6)  评论(0编辑  收藏