  <div class="layui-form-item">

    <label class="layui-form-label"><?= $title ?></label>
    <div class="layui-input-inline" style="width: 500px">
      <input type="text" name="<?= $name ?>" placeholder="<?= $desc ?>" id="upload_<?= $field ?>" autocomplete="off" class="layui-input" value="<?= $fvalue ?>">
    </div>
    <div class="layui-input-inline" style="width: 120px">
      <button type="button" class="layui-btn" id="test_<?= $field ?>" name="myfile">
        <i class="layui-icon">&#xe67c;</i>上传文件
      </button>
    </div>

    <? if ($fvalue and empty($noshow)) { ?>
      <div class="layui-input-inline">
        <a href="<?= xcx_img($fvalue) ?>" id="a_<?= $field ?>" target="_blank">
          <img src="<?= xcx_img($fvalue) ?>" alt="" id="m_<?= $field ?>" style="width: 38px; height: 38px; object-fit: cover">
        </a>
      </div>


    <? } ?>



  </div>

  <script>
    layui.use(['form', 'upload'], function() {
      var upload = layui.upload,
        $ = layui.jquery;
      upload.render({
        elem: '#test_<?= $field ?>' //绑定元素
          ,
        url: 'index.php?class=base&act=upload' //上传接口
          ,
        accept: 'file' //允许上传的文件类型
          ,
        exts: "<?= $exts ? $exts : "png|jpg|xlsx|xls" ?>",
        done: function(res) {
          //上传完毕回调


          $("#upload_<?= $field ?>").val(res.src)
          $("#a_<?= $field ?>").attr("href", '/'+res.src)
          $("#m_<?= $field ?>").attr("src", '/'+res.src)
        },
        error: function() {
          //请求异常回调

        }
      });
    })
  </script>