Commit ee61c34b authored by xieyishang's avatar xieyishang

addxx

parent 59b1fbe0
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
use app\common\model\Devleavlog as DevleavlogModel;
use fast\Tree;
use think\Db;
/**
* 分类管理
*
* @icon fa fa-list
* @remark 用于管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加
*/
class Devleavlog extends Backend
{
/**
* @var \app\common\model\Devleavlog
*/
protected $model = null;
protected $Devleavloglist = [];
protected $noNeedRight = ['selectpage'];
// public function _initialize()
// {
// parent::_initialize();
// $this->model = model('app\common\model\Devleavlog');
// $tree = Tree::instance();
// $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'pid');
// $this->Devleavloglist = $tree->getTreeList($tree->getTreeArray(0), 'name');
// $Devleavlogdata = [0 => ['type' => 'all', 'name' => __('None')]];
// foreach ($this->Devleavloglist as $k => $v) {
// $Devleavlogdata[$v['id']] = $v;
// }
// $typeList = DevleavlogModel::getTypeList();
// $this->view->assign("flagList", $this->model->getFlagList());
// $this->view->assign("typeList", $typeList);
// // $this->view->assign("parentList", $Devleavlogdata);
// $this->assignconfig('typeList', $typeList);
// }
/**
* 查看
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
if ($this->request->request('keyField')) {
return $this->selectpage();
}
$offset = $this->request->request('offset');
$limit = $this->request->request('limit');
// var_dump($offset,$limit);die;
$field = ['id','projectname','fullname','phone','corporatename', 'FROM_UNIXTIME(addtime,"%Y-%m-%d %H-%m %s") as addtime'];
$list = Db::name('devleavlog')->field($field)->limit($offset,$limit )->select();
$result['total'] = Db::name('devleavlog')->count();
$result['rows'] = $list;
return json($result);
}
return $this->view->fetch();
}
}
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh')}
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('')}"
data-operate-del="{:$auth->check('')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
{:build_toolbar('refresh')} {:build_toolbar('refresh')}
</div> </div>
<table id="table" class="table table-striped table-bordered table-hover" <table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('auth/admin/edit')}" data-operate-edit="{:$auth->check('')}"
data-operate-del="{:$auth->check('auth/admin/del')}" data-operate-del="{:$auth->check('')}"
width="100%"> width="100%">
</table> </table>
</div> </div>
......
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'devleavlog/index',
// add_url: 'devleavlog/add',
// edit_url: 'devleavlog/edit',
// del_url: 'devleavlog/del',
// multi_url: 'devleavlog/multi',
// dragsort_url: 'ajax/weigh',
table: 'devleavlog',
}
});
var table = $("#table");
var tableOptions = {
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'weigh',
pagination: true,
commonSearch: false,
search: false,
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'projectname', title: '项目名称', operate: false,},
{field: 'fullname', title: '联系人名称', align: 'left'},
{field: 'phone', title: '电话'},
{field: 'corporatename', title: '公司名称', operate: false},
{field: 'addtime', title: '添加时间'},
]
]
};
// 初始化表格
table.bootstrapTable(tableOptions);
// 为表格绑定事件
Table.api.bindevent(table);
//绑定TAB事件
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
// var options = table.bootstrapTable(tableOptions);
var typeStr = $(this).attr("href").replace('#', '');
var options = table.bootstrapTable('getOptions');
options.pageNumber = 1;
options.queryParams = function (params) {
// params.filter = JSON.stringify({type: typeStr});
params.type = typeStr;
return params;
};
table.bootstrapTable('refresh', {});
return false;
});
//必须默认触发shown.bs.tab事件
// $('ul.nav-tabs li.active a[data-toggle="tab"]').trigger("shown.bs.tab");
},
add: function () {
Controller.api.bindevent();
setTimeout(function () {
$("#c-type").trigger("change");
}, 100);
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
$(document).on("change", "#c-type", function () {
$("#c-pid option[data-type='all']").prop("selected", true);
$("#c-pid option").removeClass("hide");
$("#c-pid option[data-type!='" + $(this).val() + "'][data-type!='all']").addClass("hide");
$("#c-pid").data("selectpicker") && $("#c-pid").selectpicker("refresh");
});
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:82:"D:\phpstudy_pro\WWW\www.fa.com\public/../application/admin\view\leaving\index.html";i:1615257357;s:73:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\layout\default.html";i:1611580233;s:70:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\meta.html";i:1611580233;s:72:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\script.html";i:1611580233;}*/ ?> <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:82:"D:\phpstudy_pro\WWW\www.fa.com\public/../application/admin\view\leaving\index.html";i:1615258639;s:73:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\layout\default.html";i:1611580233;s:70:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\meta.html";i:1611580233;s:72:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\script.html";i:1611580233;}*/ ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $config['language']; ?>"> <html lang="<?php echo $config['language']; ?>">
<head> <head>
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
<?php echo build_toolbar('refresh'); ?> <?php echo build_toolbar('refresh'); ?>
</div> </div>
<table id="table" class="table table-striped table-bordered table-hover" <table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="<?php echo $auth->check('auth/admin/edit'); ?>" data-operate-edit="<?php echo $auth->check(''); ?>"
data-operate-del="<?php echo $auth->check('auth/admin/del'); ?>" data-operate-del="<?php echo $auth->check(''); ?>"
width="100%"> width="100%">
</table> </table>
</div> </div>
......
<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:85:"D:\phpstudy_pro\WWW\www.fa.com\public/../application/admin\view\devleavlog\index.html";i:1615258632;s:73:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\layout\default.html";i:1611580233;s:70:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\meta.html";i:1611580233;s:72:"D:\phpstudy_pro\WWW\www.fa.com\application\admin\view\common\script.html";i:1611580233;}*/ ?>
<!DOCTYPE html>
<html lang="<?php echo $config['language']; ?>">
<head>
<meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php endif; ?>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
<script src="/assets/js/html5shiv.js"></script>
<script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
var require = {
config: <?php echo json_encode($config); ?>
};
</script>
</head>
<body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
<div id="main" role="main">
<div class="tab-content tab-addtabs">
<div id="content">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<section class="content-header hide">
<h1>
<?php echo __('Dashboard'); ?>
<small><?php echo __('Control panel'); ?></small>
</h1>
</section>
<?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
<!-- RIBBON -->
<div id="ribbon">
<ol class="breadcrumb pull-left">
<?php if($auth->check('dashboard')): ?>
<li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
<?php endif; ?>
</ol>
<ol class="breadcrumb pull-right">
<?php foreach($breadcrumb as $vo): ?>
<li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
<?php endforeach; ?>
</ol>
</div>
<!-- END RIBBON -->
<?php endif; ?>
<div class="content">
<div class="panel panel-default panel-intro">
<?php echo build_heading(); ?>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<?php echo build_toolbar('refresh'); ?>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="<?php echo $auth->check(''); ?>"
data-operate-del="<?php echo $auth->check(''); ?>"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment