bztang-admin/plugins/video-share/views/category/edit.blade.php

123 lines
3.5 KiB
PHP

@extends('layouts.base')
@section('content')
<style>
.panel{
margin-bottom:10px!important;
padding-left: 20px;
border-radius: 10px;
}
.panel .active a {
background-color: #29ba9c!important;
border-radius: 18px!important;
color:#fff;
}
.panel a{
border:none!important;
background-color:#fff!important;
}
.content{
background: #eff3f6;
padding: 10px!important;
}
.con{
padding-bottom:20px;
position:relative;
min-height:100vh;
background-color:#fff;
border-radius: 8px;
}
.con .setting .block{
padding:10px;
background-color:#fff;
border-radius: 8px;
}
.con .setting .block .title{
display:flex;
align-items:center;
margin-bottom:15px;
}
.confirm-btn{
width: calc(100% - 266px);
position:fixed;
bottom:0;
right:0;
margin-right:10px;
line-height:63px;
background-color: #ffffff;
box-shadow: 0px 8px 23px 1px
rgba(51, 51, 51, 0.3);
background-color:#fff;
text-align:center;
}
b{
font-size:14px;
}
</style>
<div id='re_content' >
<div class="con">
<div class="setting">
<div class="block">
<div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>分类编辑</b></div>
<el-form ref="form" :model="form" label-width="15%">
<el-form-item label="排序">
<el-input v-model="form.sort" style="width:70%;"></el-input>
</el-form-item>
<el-form-item label="分类名称">
<el-input v-model="form.name" style="width:70%;"></el-input>
</el-form-item>
<el-form-item label="是否显示">
<template>
<el-switch
v-model="form.is_show"
:active-value="1"
:inactive-value="0"
>
</el-switch>
</template>
</el-form-item>
</div>
</div>
<div class="confirm-btn">
<el-button type="primary" @click="submit">提交</el-button>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: "#re_content",
delimiters: ['[[', ']]'],
data() {
let cate={!!json_encode($cate?:'{}') !!}
return {
cate_id:cate&&cate.id?cate.id:'',
form:{
name:cate&&cate.name?cate.name:'',
sort:cate&&cate.sort?cate.sort:'',
is_show:cate&&cate.is_show?cate.is_show:0,
},
}
},
mounted () {
},
methods: {
submit() {
this.$http.post('{!! yzWebFullUrl('plugin.video-share.admin.category.edit') !!}',{'cate_data':this.form,'cate_id':this.cate_id}).then(function (response){
if (response.data.result) {
this.$message({message: response.data.msg,type: 'success'});
window.location.href='{!! yzWebFullUrl('plugin.video-share.admin.category.index') !!}';
}else {
this.$message({message: response.data.msg,type: 'error'});
}
},function (response) {
this.$message({message: response.data.msg,type: 'error'});
})
},
},
});
</script>
@endsection