| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- @extends('base.base')
- @section('base')
- <!-- 内容区域 -->
- <div class="main-panel">
- <div class="content-wrapper">
- <div class="row">
- <div class="col-12 grid-margin stretch-card">
- <div class="card">
- <div class="card-body">
- <h4 class="card-title">{{ __('auto.请输入模板名称') }}</h4>
- <form class="forms-sample" id="form">
- <div class="form-group">
- <input type="text" class="form-control required" name="Name" placeholder="{{ __('auto.请输入模板名称') }}"
- value="{{$info->Name}}">
- </div>
- <div>
- <label for="">
- {{ __('auto.配置模板(所有模板百分比)') }}
- </label>
- </div>
- @foreach($GameDataText as $gamekey=>$gamename)
- <div style="width: 48%;float: left">
- <label for="">{{$gamename}}:</label>
- <input type="number" class="form-control" name="{{$gamekey}}"
- id="{{$gamekey}}" value="{{$info->$gamekey ?? '0'}}">
- </div>
- @endforeach
- <div style="clear: both"></div>
- <br>
- <button type="button" onclick="commit({{$info->ID}})"
- class="btn btn-sm btn-gradient-primary btn-icon-text">
- <i class="mdi mdi-file-check btn-icon-prepend"></i>
- {{ __('auto.提交') }}
- </button>
- <button type="button" onclick="cancel()"
- class="btn btn-sm btn-gradient-warning btn-icon-text">
- <i class="mdi mdi-reload btn-icon-prepend"></i>
- {{ __('auto.取消') }}
- </button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- function commit(ID) {
- if (!checkForm()) {
- return false;
- }
- var data = $("#form").serializeObject();
- for (var i in data) {
- if (i === 'Name') {
- continue
- }
- if (parseInt(data[i]) < 0 || parseInt(data[i]) > 100) {
- layer.msg('{{ __('auto.控制等级区间') }}0-100');
- return false;
- }
- }
- myRequest("/admin/Control/ControlConfig_update/" + ID, "post", data, function (res) {
- if (res.code == '200') {
- layer.msg(res.msg)
- setTimeout(function () {
- parent.location.reload();
- }, 1500)
- } else {
- layer.msg(res.msg)
- }
- });
- }
- function cancel() {
- parent.location.reload();
- }
- </script>
- @endsection
|