edit.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/6
  6. * Time: 下午10:12
  7. */
  8. use backend\assets\AppAsset;
  9. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/js/frontend.js')
  10. ?>
  11. <form class="layui-form" action="" style="margin-top: 50px" >
  12. <div class="layui-form-item">
  13. <label class="layui-form-label">菜单名称</label>
  14. <div class="layui-input-block" style="width: 200px;">
  15. <input type="text" name="name" value="<?php echo $model['name']?>" required lay-verify="required" placeholder="请输入菜单名称" autocomplete="off" class="layui-input">
  16. </div>
  17. </div>
  18. <div class="layui-form-item">
  19. <label class="layui-form-label">点击函数</label>
  20. <div class="layui-input-block" style="width: 200px;">
  21. <textarea rows="3" name="function" placeholder="可选项,目前用在商务通" class="layui-textarea"><?php echo $model['function']?></textarea>
  22. <!-- <input type="text" name="function" value="--><?php // echo $model['function']?><!--" placeholder="可选项,目前用在商务通" class="layui-input">-->
  23. </div>
  24. </div>
  25. <div class="layui-form-item">
  26. <label class="layui-form-label">url</label>
  27. <div class="layui-input-block" style="width: 200px;">
  28. <input type="text" name="url" value="<?php echo $model['url']?>" autocomplete="off" class="layui-input">
  29. </div>
  30. </div>
  31. <div class="layui-form-item">
  32. <label class="layui-form-label">排序</label>
  33. <div class="layui-input-block" style="width: 200px;">
  34. <input type="text" name="sort" value="<?php echo $model['sort']?>" autocomplete="off" class="layui-input">
  35. </div>
  36. </div>
  37. <div class="layui-form-item">
  38. <label class="layui-form-label">图片宽度</label>
  39. <div class="layui-input-block" style="width: 200px;">
  40. <input type="text" name="width" value="<?php echo $model['width']?>" autocomplete="off" class="layui-input" placeholder="例如:100px">
  41. </div>
  42. </div>
  43. <div class="layui-form-item xm_pr">
  44. <div class="layui-inline">
  45. <label class="layui-form-label">图标</label>
  46. <div class="layui-inline">
  47. <div class="layui-upload">
  48. <div class="layui-upload-list lay_p_relative"> <!--低级添加 lay_p_relative-->
  49. <img class="layui-upload-img layui_magnify" name="img" src="<?php echo Yii::$app->params['httpImg']['host'].Yii::$app->params['httpImg']['city'].$model['icon']; ?>" id="breviary_img" style="width:280px;height:90px;margin-left:10px;border:1px solid #ccc;">
  50. <p id="demoText"></p>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <button type="button" class="layui-btn layui-btn-primary xm_xcxqTc_button" id="test1">选择图片</button>
  56. </div>
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">状态</label>
  59. <div class="layui-input-block">
  60. <input type="radio" name="status" value="1" title="正常" <?php if($model['status'] == '1') echo 'checked'?>>
  61. <input type="radio" name="status" value="2" title="禁用" <?php if($model['status'] == '2') echo 'checked'?>>
  62. </div>
  63. </div>
  64. <div class="layui-form-item">
  65. <div class="layui-input-block">
  66. <input type="hidden" name="id" value="<?= $model['id']?>">
  67. <input type="hidden" name="pid" value="<?= $model['pid']?>">
  68. <button class="layui-btn" lay-submit="" lay-filter="editMenu" >立即提交</button>
  69. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  70. </div>
  71. </div>
  72. </form>