edit.blade.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <div style="margin-top: 10px;" id="invests-app">
  2. <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
  3. 编辑 - 投资金额
  4. </div>
  5. <el-form action="{{route('admin.invest.update',array('id'=>$model->id))}}" method="post" id="form-create">
  6. <!-- 图片 -->
  7. <!-- 链接 -->
  8. <ui-input-text label="投资名称" name="title" value="{{$model->title}}" placeholder="投资名称" maxlength="255" tips="请输入投资名称" autofocus="true"></ui-input-text>
  9. <ui-input-float-number :max="9999999" label="投资金额" name="invest_money" value="{{$model->invest_money}}" placeholder="投资金额" maxlength="255" tips="请输入投资金额" autofocus="true"></ui-input-float-number>
  10. <!-- 是否显示 -->
  11. <ui-submit></ui-submit>
  12. </el-form>
  13. </div>
  14. <script type="application/javascript">
  15. $(function () {
  16. // 注意:Vue组件一定放在jQuery.validator前面验证
  17. new Vue({
  18. el: '#invests-app',
  19. data :function () {
  20. return {
  21. };
  22. }
  23. });
  24. jQuery.validator.setDefaults({
  25. debug: false, // 调试模式true不会提交,false允许提交
  26. success: "success", // 匹配成功的class样式名称
  27. errorElement: 'div' // 兼容el标签时使用(兼容el Vue组件label.error标签问题)
  28. });
  29. // 前台数据验证 验证需要设置window.form全局变量
  30. window.form = $('#form-create').validate({
  31. rules: {
  32. image: {
  33. required: true,
  34. maxlength: 255,
  35. normalizer: function ( value ) {
  36. return $.trim(value);
  37. }
  38. },
  39. // link: {
  40. // required: true,
  41. // maxlength: 255,
  42. // normalizer: function ( value ) {
  43. // return $.trim(value);
  44. // }
  45. // },
  46. show: {
  47. required: true
  48. },
  49. sort: {
  50. required: true,
  51. normalizer: function ( value ) {
  52. return $.trim(value);
  53. }
  54. }
  55. }
  56. });
  57. // 编辑保存变量
  58. window.formDatum = $('form').serialize();
  59. });
  60. </script>
  61. @include('layouts.admin.form_script')