|
|
<!DOCTYPE html>
|
|
|
<html lang="{{ config('app.locale') }}">
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
|
<title></title>
|
|
|
<!-- Tell the browser to be responsive to screen width -->
|
|
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
|
|
|
|
|
{!! Admin::css() !!}
|
|
|
|
|
|
<script src="{{ Admin::jQuery() }}"></script>
|
|
|
|
|
|
{!! Admin::headerJs() !!}
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
|
<![endif]-->
|
|
|
|
|
|
<link type="text/css" rel="stylesheet" href="/vendor/laravel-admin/toastr/build/toastr.min.css"/>
|
|
|
<script src="/vendor/laravel-admin/toastr/build/toastr.min.js"></script>
|
|
|
<script src="/vendor/laravel-admin/jquery-pjax/jquery.pjax.js"></script>
|
|
|
<script src="/assets/layer-v3.1.1/layer/layer.js"></script>
|
|
|
<script src="/assets/layui/layui.js"></script>
|
|
|
<script src="/vendor/laravel-admin/sweetalert2/dist/sweetalert2.min.js"></script>
|
|
|
<script src="{{ admin_asset("vendor/laravel-admin/AdminLTE/plugins/iCheck/icheck.min.js")}}"></script>
|
|
|
<script src="/assets/admin/js/main.js"></script>
|
|
|
<script src="/assets/admin/js/common.js?1"></script>
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="/vendor/laravel-admin/AdminLTE/plugins/select2/select2.min.css" />
|
|
|
<script src="/vendor/laravel-admin/AdminLTE/plugins/select2/select2.full.min.js"></script>
|
|
|
<link type="text/css" rel="stylesheet" href="/assets/admin/css/main.css?11111111"/>
|
|
|
<link type="text/css" rel="stylesheet" href="/vendor/laravel-admin/sweetalert2/dist/sweetalert2.css"/>
|
|
|
<link rel="stylesheet" href="{{ admin_asset("vendor/laravel-admin/AdminLTE/plugins/iCheck/square/blue.css") }}">
|
|
|
</head>
|
|
|
<body class="hold-transition">
|
|
|
<div class="wrapper">
|
|
|
{{-- <form action="categories/{{$id}}/labels" method="post" accept-charset="UTF-8" class="" enctype="multipart/form-data" pjax-container="">--}}
|
|
|
<div class="box-body">
|
|
|
<div class="fields-group">
|
|
|
<div class="col-sm-12">
|
|
|
<div class="form-group col-sm-12 clear-both row " style="clear:both;">
|
|
|
<label for="name" class="col-sm-2 col-form-label asterisk">名称</label>
|
|
|
<div class="col-sm-10">
|
|
|
<input id="name" name="name" class="form-control name" placeholder="输入 标签名称" value="" required />
|
|
|
<span class="form-text text-muted">
|
|
|
<i class="fa fa-info-circle"></i> 名称 请勿超过 20 个字
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-sm-12 clear-both row " style="clear:both;">
|
|
|
<label for="name" class="col-sm-2 col-form-label asterisk">是否可以多选</label>
|
|
|
<div class="col-sm-10">
|
|
|
<span class="icheck">
|
|
|
<label class="radio-inline">
|
|
|
<input type="radio" name="can_multiple" value="0" class="minimal" {{ optional($label)->can_multiple == 0 ?'checked':'' }}/> 否
|
|
|
</label>
|
|
|
</span>
|
|
|
<span class="icheck">
|
|
|
<label class="radio-inline">
|
|
|
<input type="radio" name="can_multiple" value="1" class="minimal" {{ optional($label)->can_multiple == 1 ?'checked':'' }}/> 是
|
|
|
</label>
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
{{--<div class="form-group col-sm-12 clear-both row " style="clear:both;">
|
|
|
<label for="name" class="col-sm-2 col-form-label asterisk">标签语义</label>
|
|
|
<div class="col-sm-10">
|
|
|
<input id="semantics" name="semantics" class="form-control semantics" placeholder="输入 标签语义" value="{{ optional($label)->semantics }}" required />
|
|
|
<span class="form-text text-muted">
|
|
|
<i class="fa fa-info-circle"></i> 标签语义 请勿超过 100 个字
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-sm-12 clear-both row " style="clear:both;">
|
|
|
<label for="description" class="col-sm-2 col-form-label">标签描述</label>
|
|
|
<div class="col-sm-10">
|
|
|
<textarea id="description" name="description" class="form-control description" rows="5" placeholder="输入 标签描述">{{ optional($label)->description }}</textarea>
|
|
|
<span class="form-text text-muted">
|
|
|
<i class="fa fa-info-circle"></i> 回答 请勿超过 255 个字
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>--}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="card-footer" style="height: 50px!important;">
|
|
|
<div class="col-md-1"></div>
|
|
|
<div class="col-md-10 col-md-8">
|
|
|
<div class="d-flex d-sm-inline-flex align-items-center">
|
|
|
<button type="button" class="btn btn-success btn-add">提交</button>
|
|
|
{{--<button type="submit" class="btn btn-primary">提交</button>--}}
|
|
|
</div>
|
|
|
<div class="d-flex d-sm-inline-flex align-items-center"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
{{-- </form>--}}
|
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
$(function () {
|
|
|
$("input:radio").iCheck({
|
|
|
checkboxClass: 'icheckbox_square-blue',
|
|
|
radioClass: 'iradio_square-green',
|
|
|
increaseArea: '100%' // optional
|
|
|
});
|
|
|
{{--$("input:radio[name='type']").on('ifChecked', function () {--}}
|
|
|
{{-- if($(this).val()=="1"){--}}
|
|
|
{{-- // 短期密码--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.long-div').hide();--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.short-div').show();--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.password').val("{{optional($short_term)->password}}");--}}
|
|
|
{{-- var short_term_time= "{{$short_term_time}}";--}}
|
|
|
{{-- $(this).closest('.fields-group').find("input[name='short_term_time'][value='" + short_term_time+ "']").iCheck("check");--}}
|
|
|
{{-- // var date = new Date();--}}
|
|
|
{{-- // $('.enabled_at_short').datetimepicker({--}}
|
|
|
{{-- // "format":"YYYY-MM-DD HH:mm","locale":"zh-CN","allowInputToggle":true,--}}
|
|
|
{{-- // // minDate: date,--}}
|
|
|
{{-- // });--}}
|
|
|
{{-- //--}}
|
|
|
{{-- // $('.expired_at_short').datetimepicker({--}}
|
|
|
{{-- // "format":"YYYY-MM-DD HH:m","locale":"zh-CN","allowInputToggle":true,--}}
|
|
|
{{-- // // minDate: date,--}}
|
|
|
{{-- // });--}}
|
|
|
{{-- // 设置选中--}}
|
|
|
{{-- }if($(this).val()=="2"){--}}
|
|
|
|
|
|
{{-- // 长期密码--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.long-div').show();--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.short-div').hide();--}}
|
|
|
{{-- $(this).closest('.fields-group').find('.password').val("{{optional($long_term)->password}}");--}}
|
|
|
|
|
|
{{-- }--}}
|
|
|
{{-- // $(this).attr("checked",false);--}}
|
|
|
|
|
|
{{-- $(this).iCheck('update');--}}
|
|
|
{{--});--}}
|
|
|
|
|
|
$(".btn-add").click(function () {
|
|
|
let name = $("#name").val();
|
|
|
if (!name) {
|
|
|
toastr.error('请输入 标签名称。');
|
|
|
return;
|
|
|
}
|
|
|
// let semantics = $("#semantics").val();
|
|
|
// if (!semantics) {
|
|
|
// toastr.error('请输入 标签语义。');
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
let url = "/admin/categories/{{$id}}/labels";
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
type: "POST",
|
|
|
data: {
|
|
|
label_id:"{{$label_id}}",
|
|
|
name:name,
|
|
|
can_multiple:$("input[name='can_multiple']:checked").val(),
|
|
|
// semantics:semantics,
|
|
|
// description:$("#description").val(),
|
|
|
_token: LA.token,
|
|
|
_method: 'POST'
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (data.code === 0) {
|
|
|
toastr.success(data.message);
|
|
|
window.parent.location.reload()
|
|
|
} else {
|
|
|
toastr.error(data.message);
|
|
|
}
|
|
|
},
|
|
|
complete:function(xhr,status) {
|
|
|
// if (status == 'success') {
|
|
|
// // _status = xhr.responseJSON.status;
|
|
|
//
|
|
|
// }
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
|
|
|
function LA() {}
|
|
|
LA.token = "{{ csrf_token() }}";
|
|
|
</script> |
...
|
...
|
|