123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- {extend name="public/layout" /} {block name="title"}文章分类管理{/block} {block name="body"}
- <style type="text/css">
- html,
- body {
- display: block;
- background-color: #fff;
- }
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
- .layui-fluid {
- display: block;
- border-radius: 5px;
- background-color: #ffffff;
- padding: 15px 30px;
- }
- .layui-tab {
- padding: 15px;
- height: 100%;
- }
- .layui-form-item {
- width: 100%;
- }
- .layui-form-item .layui-inline {
- display: block;
- float: left;
- width: 145px;
- height: 38px;
- line-height: 38px;
- background: #FFFFFF;
- margin-right: 16px;
- }
- .layui-form-item .layui-input-inline {
- width: 145px;
- height: 38px;
- line-height: 38px;
- margin-bottom: 0;
- }
- .layui-icon {
- font-size: 20px !important;
- }
- .layui-form-item .layui-input-inline .layui-input {
- border: 1px solid #9DB6CF;
- border-radius: 5px;
- }
- .layui-form-select dl dd.layui-this {
- background-color: #249EFB;
- }
- .layui-form-item div.searchBox {
- width: 320px;
- background: #FFFFFF;
- border: 1px solid #B6CADE;
- border-radius: 24px;
- height: 38px;
- overflow: hidden;
- padding-left: 18px;
- position: relative;
- margin-bottom: 0px;
- float: right;
- }
- .searchBox .inputBox {
- width: 240px;
- float: left;
- height: 36px;
- line-height: 36px;
- border-width: 0;
- }
- .searchBtn {
- position: absolute;
- top: 0;
- right: 0;
- width: 51px;
- height: 38px;
- background-color: #fff;
- }
- .searchBtn img {
- position: absolute;
- width: 26px;
- top: 6px;
- left: 0;
- }
- .layui-card .layui-tab {
- margin: 0;
- height: 31%;
- width: 80%;
- float: right;
- padding: 1px;
- }
- .layui-btn-primary {
- color: #249EFB;
- border: 1px solid #249EFB;
- }
- .layui-btn-primary:hover {
- background-color: #E3F7FF;
- color: #249EFB;
- }
- .layui-btn-xs,.layui-btn-xs:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- padding: 0px 10px;
- }
- .layui-btn-danger,.layui-btn-danger:hover{
- color: #FF5722;
- background-color: #fff;
- border: 1px solid #FF5722;
- padding: 0px 10px;
- }
- .layui-card-header {
- background-color: #F6FAFD;
- }
- .layui-card-body {
- padding: 10px 0px 0px;
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-header layuiadmin-card-header-auto">
- <a href="#" type="button" class="layui-btn layui-btn-primary" id="cate_add">添加标签</a>
- </div>
- <div class="layui-card-body">
- <table id="evidence-table" lay-filter="evidence-table"></table>
- </div>
- </div>
- </div>
- </body>
- {/block} {block name="js"}
- <script type="text/html" id="show">
- <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.publish == 1 ? 'checked' : '' }}>
- </script>
- <script type="text/html" id="table-evidence-action">
- {{# if(d.show == 0){ }}
- <a class="layui-btn layui-btn-xs" lay-event="evi-details">编辑</a>
- <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="evidence-delete">删除</a>
- {{# }else{ }}
- <a class="layui-btn layui-btn-xs layui-btn-disabled" style="border: 1px solid #ccc;color: #ccc;">编辑</a>
- <a class="layui-btn layui-btn-xs layui-btn-disabled" style="border: 1px solid #ccc;color: #ccc;">删除</a>
- {{# } }}
- </script>
- <script type="text/html" id="evidence_num">
- <span>{{d.picnum}}</span>
- </script>
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'table', 'element'], function () {
- var $ = layui.$,
- form = layui.form,
- element = layui.element,
- table = layui.table;
- //添加分类
- $('#cate_add').click(function(){
- layer.open({
- type: 2,
- title: ['添加标签', 'color:#333333;background-color:#D8E6F1;'],
- content:'{:url("video/cate_video_labels_add")}',
- resize: false,
- area: ['400px', '260px'],
- end: function () {
- location.reload();
- }
- });
- // layer.prompt({title:'添加',value:''},function(value,index){
- // if (value=='') {
- // layer.msg('请填写名称', {
- // anim: 6
- // ,time: 400
- // });
- // return false;
- // }
- // if(value.length > 6) {
- // layer.msg('分类名称超长', {
- // anim: 6
- // ,time: 400
- // });
- // return false;
- // }
- // $.ajax({
- // url: '{:url("article/cate_article_add_label")}',
- // type: 'post',
- // data: {name:value,pid:pid},
- // dataType: 'json',
- // success: function(res) {
- // console.log(res)
- // if(res.code === 0) {
- // layer.msg(res.msg, {
- // anim: 6
- // ,time: 400
- // });
- // //执行重载
- // table.reload('evidence-table', {
- // });
- // } else {
- // layer.msg(res.msg, {
- // anim: 6
- // ,time: 400
- // });
- // }
- // }
- // });
- // layer.close(index);
- // });
- });
- //客户见证列表
- table.render({
- elem: '#evidence-table',
- autoSort: false,
- url:'{:url("video/cate_video_list_labels")}',
- cols: [
- [{
- type: 'numbers',
- field: 'id',
- width: 80,
- title: '序号',
- sort: true
- }, {
- field: 'pname',
- title: '所属分类'
- }, {
- field: 'name',
- title: '名称'
- },{
- title: '操作',
- width: 240,
- align: 'center',
- fixed: 'right',
- toolbar: '#table-evidence-action'
- }]
- ],
- page: true,
- limit: 30,
- height: 'full-120',
- text: '对不起,加载出现异常!'
- });
- //监听列表
- table.on('tool(evidence-table)', function (obj) {
- var data = obj.data;
- if (obj.event === 'evidence-delete') {
- //监听关联的数量
- $.ajax({
- url: '{:url("video/with_type_count")}',
- type: 'post',
- data: { id: data.id, type: 'label' },
- dataType: 'json',
- success: function (msg) {
- layer.confirm(msg, { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function () {
- $.get("{:url('video/delete_type_or_label')}?id=" + data.id + "&type=label&pid=" + data.pid, function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, { anim: 0 }, function () {
- table.reload('evidence-table');
- });
- } else {
- layer.msg(res.msg, { anim: 6 });
- }
- });
- });
- }
- });
-
- } else if (obj.event === 'evi-details') {
- layer.open({
- type: 2,
- title: ['编辑标签', 'color:#333333;background-color:#D8E6F1;'],
- content:'{:url("video/cate_video_labels_add")}?id=' + data.id + '&pid=' + data.pid + '&name=' + data.name,
- resize: false,
- area: ['400px', '260px'],
- end: function () {
- location.reload();
- }
- });
- }
- });
- //备注
- $('body').on('mouseover', '.remarksInfo', function () {
- var type = $(this).data('type');
- layer.tips(type, this, {
- tips: [1, '#3595CC'],
- time: 400
- });
- });
- form.on('switch(show)', function (obj) {
- var id = obj.value;
- $.ajax({
- type: "post",
- url: '{:url("video/apipublish")}',
- data: {
- id: id,
- cate: 'evidence'
- },
- success: function (res) {
- layer.msg(res.msg);
- }
- });
- });
- });
- </script>
- {/block}
|