• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

中国省/市/区(县)三级级联选择器

Distpicker extension for laravel-admin

Distpicker是一个中国省市区三级联动选择组件,这个包是基于Distpickerlaravel-admin扩展,用来将Distpicker集成进laravel-admin的表单中

截图

wx20180905-212332

安装

composer require laravel-admin-ext/china-distpicker

然后

php artisan vendor:publish --tag=laravel-admin-china-distpicker

配置

config/admin.php文件的extensions配置部分,加上属于这个扩展的配置

    'extensions' => [

        'china-distpicker' => [
        
            // 如果要关掉这个扩展,设置为false
            'enable' => true,
        ]
    ]

使用

表单中使用

比如在表中有三个字段province_id, city_id, district_id, 在form表单中使用它:

$form->distpicker(['province_id', 'city_id', 'district_id']);

设置默认值

$form->distpicker([
    'province_id' => '省份',
    'city_id' => '市',
    'district_id' => '区'
], '地域选择')->default([
    'province' => 130000,
    'city'     => 130200,
    'district' => 130203,
]);

可以设置每个字段的placeholder

$form->distpicker([
    'province_id' => '省',
    'city_id'     => '市',
    'district_id' => '区'
]);

设置label

$form->distpicker(['province_id', 'city_id', 'district_id'], '请选择区域');

设置自动选择, 可以设置1,2,3 表示自动选择到第几级

$form->distpicker(['province_id', 'city_id', 'district_id'])->autoselect(1);

表格筛选中使用

$filter->distpicker('province_id', 'city_id', 'district_id', '地域选择');

地区编码数据

Distpicker所使用的地域编码是基于国家统计局发布的数据, 数据字典为china_area.sql文件.

支持

如果觉得这个项目帮你节约了时间,不妨支持一下;)

-1

License

Licensed under The MIT License (MIT).

More Repositories

1

helpers

Several tools to help you in development
PHP
135
star
2

media-manager

Provides a web interface to manage local files
Blade
134
star
3

log-viewer

Log viewer for laravel
PHP
129
star
4

redis-manager

Redis manager for laravel-admin
HTML
103
star
5

chartjs

Use Chartjs in laravel-admin
PHP
102
star
6

config

Config manager for laravel-admin
PHP
95
star
7

material-ui

Material-UI extension for laravel-admin
PHP
95
star
8

scheduling

Scheduling task manager for laravel-admin
PHP
92
star
9

large-file-upload

An Extension For Laravel-Admin
JavaScript
75
star
10

backup

An admin interface for managing backups
PHP
74
star
11

cropper

PHP
73
star
12

latlong

A latitude & longitude selector
PHP
69
star
13

UEditor

UEditor extension for laravel-admin
PHP
62
star
14

wangEditor

wangEditor extension for laravel-admin
JavaScript
61
star
15

grid-lightbox

Turn your grid into a lightbox & gallery
CSS
58
star
16

reporter

This tool stores the exception information into the database and provides a developer-friendly web interface to view the exception information.
PHP
58
star
17

api-tester

API tester for laravel-admin
Blade
55
star
18

grid-sortable

WIP
PHP
40
star
19

summernote

Summernote extension for laravel-admin
PHP
37
star
20

env-manager

Env Manager for Laravel-admin
PHP
34
star
21

id-validator

验证中国大陆居民身份证、港澳居民居住证以及台湾地区居民居住证
PHP
34
star
22

daterangepicker

Integrates daterangepicker into laravel-admin
JavaScript
33
star
23

simplemde

Simplemde markdown editor extension for laravel-admin
PHP
33
star
24

data-table

data table for laravel-admin
PHP
32
star
25

media-player

Play audio/videos in laravel-admin
JavaScript
31
star
26

json-editor

JSON Editor for Laravel-admin
PHP
31
star
27

ckeditor

Integrate CKEDITOR into laravel-admin
JavaScript
30
star
28

phpinfo

Outputs information about PHP's configuration in laravel-admin
PHP
27
star
29

composer-viewer

Composer Viewer for Laravel-admin
PHP
27
star
30

multi-language

Blade
25
star
31

quill

Quill Editor extension for laravel-admin
CSS
23
star
32

lock-screen

PHP
22
star
33

messages

PHP
21
star
34

admin-config

Manage your database configuration as profiles
PHP
21
star
35

star-rating

Star Rating extension for laravel-admin
JavaScript
21
star
36

simditor

Integrates simditor into Laravel-admin
JavaScript
16
star
37

sparkline

Integrates jQuery sparkline into laravel-admin
PHP
16
star
38

code-mirror

Code editor extension for laravel-admin
JavaScript
15
star
39

tencent-map

PHP
15
star
40

file-browser

A Simple File Browser Extension For Laravel-Admin
HTML
15
star
41

auth-attempts

Add captcha and login attempts for laravel-admin
HTML
14
star
42

translation

PHP
12
star
43

file-manager

file-manager for laravel-admin
HTML
12
star
44

rbac

开发中,勿安装
PHP
10
star
45

watermark

PHP
10
star
46

lodpod-editor

Lodpod print template visual editor LodPod打印模板Web可视化编辑器扩展
JavaScript
10
star
47

select-tree

数据模型树 的 select 联动选择插件
HTML
9
star
48

wangEditor2

wangEditor v2 for Laravel-admin
PHP
9
star
49

echarts

baidu echarts for laravel-admin
PHP
9
star
50

data-dictionary

Mysql Data dictionary, Mysql数据字典
HTML
9
star
51

php-editor

PHP editor extension for laravel-admin based on code-mirror
PHP
8
star
52

code-editor

PHP
6
star
53

typeahead

Integrates Typeahead.js into laravel-admin
PHP
5
star
54

screenfull

This is an extension to integrates screenfull.js into laravel-admin.
PHP
4
star
55

python-editor

Python editor extension for laravel-admin based on code-mirror
PHP
4
star
56

component-js

JavaScript
4
star
57

js-editor

Javascript editor extension for laravel-admin based on code-mirror
PHP
4
star
58

clike-editor

Several c-lick language editor extensions for laravel-admin based on code-mirror
PHP
3
star
59

aliyun-sms

阿里云短信扩展
2
star
60

css-editor

CSS editor extension for laravel-admin based on code-mirror
PHP
2
star