# dragon_op_bg **Repository Path**: wangwenfan/dragon_op_bg ## Basic Information - **Project Name**: dragon_op_bg - **Description**: 君临运营后台 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-03-24 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 使用说明 ##### 环境 - 环境:php7.1+mysql5.6+erlang5.9.3.1(需要安装php binary扩展) ##### 项目部署 - 克隆代码 `git clone https://gitee.com/wangwenfan/dragon_op_bg.git` - 开发环境 `composer install`,生成环境`composer install --no-dev` - 修改.env配置文件 - 分别执行 `php artisan admin:install`,`php artisan migrate`,`php artisan db:seed --class=MenuSeeder`迁移数据库 ##### 需要手动修改的文件 - `Encore\Admin\Grid\Exporters\CsvExporter.php`24行export里 增加 `echo "\xEF\xBB\xBF";`解决Excel导出中文乱码问题 - `Encore\Admin\Grid` 新增属性和方法 ``` //取消条件查询 protected $filterCondition = false; /** * [setfilterCondition 取消where条件查询] * @Author 王文凡 * @DateTime 2018-05-02 * @version 1.0 */ public function setNotWhere($attributes = []) { $this->filterCondition = $attributes; return $this; } ``` - `Encore\Admin\Form\Field\Select.php` 增加ajaxLoad方法 ``` /** * 二级联动,支持ajax分页请求数据, * * @param string $field ,父级 * @param string $sourceUrl * @param string $idField * @param string $textField * * @return $this */ public function ajaxLoad($field, $sourceUrl, $idField = 'id', $textField = 'text') { if (Str::contains($field, '.')) { $field = $this->formatName($field); $class = str_replace(['[', ']'], '_', $field); } else { $class = $field; } $this->script = <<getElementClassSelector()}"); var target = current.closest('.fields-group').find(".$class"); var init=function (){ current.select2({ ajax: { url: "$sourceUrl", dataType: 'json', delay: 250, data: function (params) { return { father_value:target.val(), q: params.term, page: params.page }; }, processResults: function (data, params) { params.page = params.page || 1; return { results: $.map(data.data, function (d) { d.id = d.$idField; d.text = d.$textField; return d; }), pagination: { more: data.next_page_url } }; }, cache: true }, allowClear: true, placeholder: "{$this->label}", minimumInputLength: 1, escapeMarkup: function (markup) { return markup; } }); } init(); $(document).on('change', "{$this->getElementClassSelector()}", function () { init(); }); EOT; return $this; } ```