省市区选择插件
This commit is contained in:
parent
3756b0a012
commit
ff080bc307
|
|
@ -71,7 +71,7 @@ public class AssetsCabinetController extends BaseController {
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add(ModelMap mmap) {
|
public String add(ModelMap mmap) {
|
||||||
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
|
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
|
||||||
mmap.put("machineRooms",list);
|
mmap.put("machineRooms", list);
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ public class AssetsCabinetController extends BaseController {
|
||||||
* 新增保存机柜类型
|
* 新增保存机柜类型
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsCabinet:add")
|
@RequiresPermissions("assets:assetsCabinet:add")
|
||||||
@Log(title = "机柜类型", businessType = BusinessType.INSERT)
|
@Log(title = "机柜管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(AssetsCabinet assetsCabinet) {
|
public AjaxResult addSave(AssetsCabinet assetsCabinet) {
|
||||||
|
|
@ -93,7 +93,7 @@ public class AssetsCabinetController extends BaseController {
|
||||||
public String edit(@PathVariable("cabinetId") Integer cabinetId, ModelMap mmap) {
|
public String edit(@PathVariable("cabinetId") Integer cabinetId, ModelMap mmap) {
|
||||||
AssetsCabinet assetsCabinet = assetsCabinetService.selectAssetsCabinetById(cabinetId);
|
AssetsCabinet assetsCabinet = assetsCabinetService.selectAssetsCabinetById(cabinetId);
|
||||||
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
|
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
|
||||||
mmap.put("machineRooms",list);
|
mmap.put("machineRooms", list);
|
||||||
mmap.put("assetsCabinet", assetsCabinet);
|
mmap.put("assetsCabinet", assetsCabinet);
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ public class AssetsCabinetController extends BaseController {
|
||||||
* 修改保存机柜类型
|
* 修改保存机柜类型
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsCabinet:edit")
|
@RequiresPermissions("assets:assetsCabinet:edit")
|
||||||
@Log(title = "机柜类型", businessType = BusinessType.UPDATE)
|
@Log(title = "机柜管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(AssetsCabinet assetsCabinet) {
|
public AjaxResult editSave(AssetsCabinet assetsCabinet) {
|
||||||
|
|
@ -113,7 +113,7 @@ public class AssetsCabinetController extends BaseController {
|
||||||
* 删除机柜类型
|
* 删除机柜类型
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsCabinet:remove")
|
@RequiresPermissions("assets:assetsCabinet:remove")
|
||||||
@Log(title = "机柜类型", businessType = BusinessType.DELETE)
|
@Log(title = "机柜管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids) {
|
public AjaxResult remove(String ids) {
|
||||||
|
|
|
||||||
|
|
@ -24,101 +24,92 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/assets/assetsMachineRoom")
|
@RequestMapping("/assets/assetsMachineRoom")
|
||||||
public class AssetsMachineRoomController extends BaseController
|
public class AssetsMachineRoomController extends BaseController {
|
||||||
{
|
|
||||||
private String prefix = "assets/assetsMachineRoom";
|
private String prefix = "assets/assetsMachineRoom";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAssetsMachineRoomService assetsMachineRoomService;
|
private IAssetsMachineRoomService assetsMachineRoomService;
|
||||||
|
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:view")
|
@RequiresPermissions("assets:assetsMachineRoom:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String assetsMachineRoom()
|
public String assetsMachineRoom() {
|
||||||
{
|
return prefix + "/assetsMachineRoom";
|
||||||
return prefix + "/assetsMachineRoom";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询机房列表
|
* 查询机房列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:list")
|
@RequiresPermissions("assets:assetsMachineRoom:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(AssetsMachineRoom assetsMachineRoom)
|
public TableDataInfo list(AssetsMachineRoom assetsMachineRoom) {
|
||||||
{
|
startPage();
|
||||||
startPage();
|
|
||||||
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
|
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出机房列表
|
* 导出机房列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:export")
|
@RequiresPermissions("assets:assetsMachineRoom:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(AssetsMachineRoom assetsMachineRoom)
|
public AjaxResult export(AssetsMachineRoom assetsMachineRoom) {
|
||||||
{
|
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
|
||||||
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
|
|
||||||
ExcelUtil<AssetsMachineRoom> util = new ExcelUtil<AssetsMachineRoom>(AssetsMachineRoom.class);
|
ExcelUtil<AssetsMachineRoom> util = new ExcelUtil<AssetsMachineRoom>(AssetsMachineRoom.class);
|
||||||
return util.exportExcel(list, "assetsMachineRoom");
|
return util.exportExcel(list, "assetsMachineRoom");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增机房
|
* 新增机房
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add()
|
public String add() {
|
||||||
{
|
return prefix + "/add";
|
||||||
return prefix + "/add";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存机房
|
* 新增保存机房
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:add")
|
@RequiresPermissions("assets:assetsMachineRoom:add")
|
||||||
@Log(title = "机房", businessType = BusinessType.INSERT)
|
@Log(title = "机房管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(AssetsMachineRoom assetsMachineRoom)
|
public AjaxResult addSave(AssetsMachineRoom assetsMachineRoom) {
|
||||||
{
|
return toAjax(assetsMachineRoomService.insertAssetsMachineRoom(assetsMachineRoom));
|
||||||
return toAjax(assetsMachineRoomService.insertAssetsMachineRoom(assetsMachineRoom));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改机房
|
* 修改机房
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{machineRoomId}")
|
@GetMapping("/edit/{machineRoomId}")
|
||||||
public String edit(@PathVariable("machineRoomId") Integer machineRoomId, ModelMap mmap)
|
public String edit(@PathVariable("machineRoomId") Integer machineRoomId, ModelMap mmap) {
|
||||||
{
|
AssetsMachineRoom assetsMachineRoom = assetsMachineRoomService.selectAssetsMachineRoomById(machineRoomId);
|
||||||
AssetsMachineRoom assetsMachineRoom = assetsMachineRoomService.selectAssetsMachineRoomById(machineRoomId);
|
mmap.put("assetsMachineRoom", assetsMachineRoom);
|
||||||
mmap.put("assetsMachineRoom", assetsMachineRoom);
|
return prefix + "/edit";
|
||||||
return prefix + "/edit";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存机房
|
* 修改保存机房
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:edit")
|
@RequiresPermissions("assets:assetsMachineRoom:edit")
|
||||||
@Log(title = "机房", businessType = BusinessType.UPDATE)
|
@Log(title = "机房管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(AssetsMachineRoom assetsMachineRoom)
|
public AjaxResult editSave(AssetsMachineRoom assetsMachineRoom) {
|
||||||
{
|
return toAjax(assetsMachineRoomService.updateAssetsMachineRoom(assetsMachineRoom));
|
||||||
return toAjax(assetsMachineRoomService.updateAssetsMachineRoom(assetsMachineRoom));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除机房
|
* 删除机房
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("assets:assetsMachineRoom:remove")
|
@RequiresPermissions("assets:assetsMachineRoom:remove")
|
||||||
@Log(title = "机房", businessType = BusinessType.DELETE)
|
@Log(title = "机房管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping( "/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids) {
|
||||||
{
|
return toAjax(assetsMachineRoomService.deleteAssetsMachineRoomByIds(ids));
|
||||||
return toAjax(assetsMachineRoomService.deleteAssetsMachineRoomByIds(ids));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
101
ruoyi-admin/src/main/resources/static/node_modules/distpicker/CHANGELOG.md
generated
vendored
Executable file
101
ruoyi-admin/src/main/resources/static/node_modules/distpicker/CHANGELOG.md
generated
vendored
Executable file
|
|
@ -0,0 +1,101 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2.0.5 (Dec 1, 2018)
|
||||||
|
|
||||||
|
- Fixed the issue of trigger change event twice (#68).
|
||||||
|
|
||||||
|
## 2.0.4 (Jun 1, 2018)
|
||||||
|
|
||||||
|
- Update districts.
|
||||||
|
|
||||||
|
## 2.0.3 (Mar 1, 2018)
|
||||||
|
|
||||||
|
- Update districts.
|
||||||
|
|
||||||
|
## 2.0.2 (Dec 1, 2017)
|
||||||
|
|
||||||
|
- Trigger change event once district changed.
|
||||||
|
- Support to load in node environment.
|
||||||
|
- Update districts.
|
||||||
|
|
||||||
|
## 2.0.1 (Sep 1, 2017)
|
||||||
|
|
||||||
|
- Update districts.
|
||||||
|
|
||||||
|
## 2.0.0 (Jun 1, 2017)
|
||||||
|
|
||||||
|
- Update districts.
|
||||||
|
- Use `window.jQuery` instead of `window.$` for browser side usage.
|
||||||
|
- Change the `main` field value from `dist/distpicker.js` (UMD) to `dist/distpicker.common.js` (CommonJS).
|
||||||
|
- Added `module` and `browser` fields to `package.json`.
|
||||||
|
|
||||||
|
## 2.0.0-rc (Mar 4, 2017)
|
||||||
|
|
||||||
|
- Update districts.
|
||||||
|
|
||||||
|
## 2.0.0-beta.2 (Dec 8, 2016)
|
||||||
|
|
||||||
|
- Build the source code with [Rollup](https://github.com/rollup/rollup).
|
||||||
|
|
||||||
|
## 2.0.0-beta.1 (Oct 15, 2016)
|
||||||
|
|
||||||
|
- Fixed the issue of restoring saved districts by code (#19).
|
||||||
|
|
||||||
|
## 2.0.0-alpha.2 (Sep 6, 2016)
|
||||||
|
|
||||||
|
- Rename `autoSelect` option to `autoselect`.
|
||||||
|
- Subdivide optional values for `autoselect` option (#13).
|
||||||
|
- Fixed the wrong value of the `<select>` elements (#18).
|
||||||
|
|
||||||
|
## 2.0.0-alpha.1 (Aug 11, 2016)
|
||||||
|
|
||||||
|
- Merge the `distpicker.data.js` file to the `distpicker.js` file.
|
||||||
|
- Added a new option: `valueType`.
|
||||||
|
- Added a new method: `getDistricts`.
|
||||||
|
|
||||||
|
## 1.0.4 (Jun 1, 2016)
|
||||||
|
|
||||||
|
- Update districts data.
|
||||||
|
|
||||||
|
## 1.0.3 (Mar 3, 2016)
|
||||||
|
|
||||||
|
- Update districts data.
|
||||||
|
|
||||||
|
## 1.0.2 (Dec 26, 2015)
|
||||||
|
|
||||||
|
- Update lots of districts.
|
||||||
|
|
||||||
|
## 1.0.1 (Sep 6, 2015)
|
||||||
|
|
||||||
|
- Added new cities of Xizang (Tibet).
|
||||||
|
|
||||||
|
## 1.0.0 (Aug 27, 2015)
|
||||||
|
|
||||||
|
- Added new districts of Sanya city.
|
||||||
|
- Optimized code style.
|
||||||
|
|
||||||
|
## 0.2.1 (Dec 26, 2014)
|
||||||
|
|
||||||
|
- Enable to change the global default options.
|
||||||
|
- Fix placeholder bug.
|
||||||
|
- Improve code.
|
||||||
|
|
||||||
|
## 0.2.0 (Dec 20, 2014)
|
||||||
|
|
||||||
|
- Add new options: "autoSelect", "placeholder".
|
||||||
|
- Add new methods: "reset", "destroy".
|
||||||
|
- Use "data-distpicker" attribute for initializing automatically instead of "distpicker" attribute.
|
||||||
|
|
||||||
|
## 0.1.3 (Aug 9, 2014)
|
||||||
|
|
||||||
|
- Improve
|
||||||
|
|
||||||
|
## 0.1.2 (Apr 8, 2014)
|
||||||
|
|
||||||
|
- Fix a type error bug when initialize a city without districts.
|
||||||
|
|
||||||
|
## 0.1.1 (Feb 21, 2014)
|
||||||
|
|
||||||
|
- Fix bug: The default options will be changed when use multiple times in one page.
|
||||||
|
|
||||||
|
## 0.1.0 (Jan 25, 2014)
|
||||||
21
ruoyi-admin/src/main/resources/static/node_modules/distpicker/LICENSE
generated
vendored
Normal file
21
ruoyi-admin/src/main/resources/static/node_modules/distpicker/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2014-present Chen Fengyuan
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
259
ruoyi-admin/src/main/resources/static/node_modules/distpicker/README.md
generated
vendored
Normal file
259
ruoyi-admin/src/main/resources/static/node_modules/distpicker/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,259 @@
|
||||||
|
# Distpicker
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/distpicker) [](https://www.npmjs.com/package/distpicker)
|
||||||
|
|
||||||
|
> A simple jQuery plugin for picking provinces, cities and districts of China.
|
||||||
|
|
||||||
|
- [Website](https://fengyuanchen.github.io/distpicker)
|
||||||
|
|
||||||
|
> 请注意以下市/县并未设置下一级的区/乡/镇:济源市、潜江市、神农架林区、天门市、仙桃市、东莞市、中山市、东沙群岛、白沙黎族自治县、保亭黎族苗族自治县、昌江黎族自治县、澄迈县、儋州市、定安县、东方市、乐东黎族自治县、临高县、陵水黎族自治县、琼海市、琼中黎族苗族自治县、屯昌县、万宁市、文昌市、五指山市、嘉峪关市、阿拉尔市、北屯市、可克达拉市、昆玉市、石河子市、双河市、铁门关市、图木舒克市、五家渠市。
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
- [Main](#main)
|
||||||
|
- [Getting started](#getting-started)
|
||||||
|
- [Options](#options)
|
||||||
|
- [Methods](#methods)
|
||||||
|
- [No conflict](#no-conflict)
|
||||||
|
- [Browser support](#browser-support)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
## Main
|
||||||
|
|
||||||
|
```text
|
||||||
|
dist/
|
||||||
|
├── distpicker.js (UMD)
|
||||||
|
├── distpicker.min.js (UMD, compressed)
|
||||||
|
├── distpicker.common.js (CommonJS, default)
|
||||||
|
└── distpicker.esm.js (ES Module)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
### Install
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm install distpicker
|
||||||
|
```
|
||||||
|
|
||||||
|
Include files:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
|
||||||
|
<script src="/path/to/distpicker.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
Create HTML elements:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div><!-- container -->
|
||||||
|
<select></select><!-- province -->
|
||||||
|
<select></select><!-- city -->
|
||||||
|
<select></select><!-- district -->
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
#### Initialize with `data-toggle="distpicker"` attribute
|
||||||
|
|
||||||
|
Basic
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div data-toggle="distpicker">
|
||||||
|
<select></select>
|
||||||
|
<select></select>
|
||||||
|
<select></select>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom placeholders
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div data-toggle="distpicker">
|
||||||
|
<select data-province="---- 选择省 ----"></select>
|
||||||
|
<select data-city="---- 选择市 ----"></select>
|
||||||
|
<select data-district="---- 选择区 ----"></select>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom districts
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div data-toggle="distpicker">
|
||||||
|
<select data-province="浙江省"></select>
|
||||||
|
<select data-city="杭州市"></select>
|
||||||
|
<select data-district="西湖区"></select>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Initialize with `$.fn.distpicker` method
|
||||||
|
|
||||||
|
Basic
|
||||||
|
|
||||||
|
```js
|
||||||
|
$('#target').distpicker();
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom placeholders
|
||||||
|
|
||||||
|
```js
|
||||||
|
$('#target').distpicker({
|
||||||
|
province: '---- 所在省 ----',
|
||||||
|
city: '---- 所在市 ----',
|
||||||
|
district: '---- 所在区 ----'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom districts
|
||||||
|
|
||||||
|
```js
|
||||||
|
$('#target').distpicker({
|
||||||
|
province: '浙江省',
|
||||||
|
city: '杭州市',
|
||||||
|
district: '西湖区'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
[⬆ back to top](#table-of-contents)
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
- Change the default options with `$().distpicker(options)`.
|
||||||
|
- Change the global default options with `$.fn.distpicker.setDefaults(options)`.
|
||||||
|
|
||||||
|
Also supports to set the options by `data-*` attributes:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div data-toggle="distpicker" data-autoselect="3" data-province="浙江省">...</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### autoselect
|
||||||
|
|
||||||
|
- Type: `Number`
|
||||||
|
- Options:
|
||||||
|
- `0`: Disable autoselect.
|
||||||
|
- `1`: Autoselect province only.
|
||||||
|
- `2`: Autoselect province and city only.
|
||||||
|
- `3`: Autoselect all (province, city and district).
|
||||||
|
- Default: `0`
|
||||||
|
|
||||||
|
Selects the districts automatically.
|
||||||
|
|
||||||
|
### placeholder
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `true`
|
||||||
|
|
||||||
|
Show placeholder (with an `<option>` element).
|
||||||
|
|
||||||
|
### valueType
|
||||||
|
|
||||||
|
- Type: `String`
|
||||||
|
- Options:
|
||||||
|
- `'name'`: administrative division name.
|
||||||
|
- `'code'`: administrative division code.
|
||||||
|
- Default: `'name'`
|
||||||
|
|
||||||
|
Defines the value type of the `<select>` element.
|
||||||
|
|
||||||
|
Note that this option in `data-*` attribute should be `data-value-type`:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div data-toggle="distpicker" data-value-type="code">...</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### province
|
||||||
|
|
||||||
|
- Type: `String`
|
||||||
|
- Default: `—— 省 ——`
|
||||||
|
|
||||||
|
Defines the initial value of province `<select>`. If it is a valid province, it will be selected. If not, it will be used as a placeholder.
|
||||||
|
|
||||||
|
### city
|
||||||
|
|
||||||
|
- Type: `String`
|
||||||
|
- Default: `—— 市 ——`
|
||||||
|
|
||||||
|
Defines the initial value of city `<select>`. If it is a valid city under the selected province, it will be selected. If not, it will be used as a placeholder.
|
||||||
|
|
||||||
|
### district
|
||||||
|
|
||||||
|
- Type: `String`
|
||||||
|
- Default: `—— 区 ——`
|
||||||
|
|
||||||
|
Defines the initial value of district `<select>`. If it is a valid district under the selected city, it will be selected. If not, it will be used as a placeholder.
|
||||||
|
|
||||||
|
[⬆ back to top](#table-of-contents)
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### getDistricts([districtCode])
|
||||||
|
|
||||||
|
- **districtCode** (optional):
|
||||||
|
- Type: `Number`
|
||||||
|
- The district code of target country, province or city.
|
||||||
|
- If not present, will return all the districts.
|
||||||
|
|
||||||
|
- (return value):
|
||||||
|
- Type: `Object`
|
||||||
|
|
||||||
|
Get districts data.
|
||||||
|
|
||||||
|
```js
|
||||||
|
$().distpicker('getDistricts'); // 中国
|
||||||
|
$().distpicker('getDistricts', 330000); // 浙江省
|
||||||
|
$().distpicker('getDistricts', 330100); // 杭州市
|
||||||
|
```
|
||||||
|
|
||||||
|
### reset([deep])
|
||||||
|
|
||||||
|
- **deep** (optional):
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
- Reset the selects to default states (Undo selected).
|
||||||
|
|
||||||
|
Reset the selects to the initial states (Undo changed).
|
||||||
|
|
||||||
|
```js
|
||||||
|
$().distpicker('reset');
|
||||||
|
$().distpicker('reset', true);
|
||||||
|
```
|
||||||
|
|
||||||
|
### destroy()
|
||||||
|
|
||||||
|
Destroy the distpicker instance, but keep the selected districts.
|
||||||
|
|
||||||
|
If you want to remove the selected districts, you can call `reset` method first and then call this method.
|
||||||
|
|
||||||
|
[⬆ back to top](#table-of-contents)
|
||||||
|
|
||||||
|
## No conflict
|
||||||
|
|
||||||
|
If you have to use other plugin with the same namespace, just call the `$.fn.distpicker.noConflict` method to revert to it.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="other-plugin.js"></script>
|
||||||
|
<script src="distpicker.js"></script>
|
||||||
|
<script>
|
||||||
|
$.fn.distpicker.noConflict();
|
||||||
|
// Code that uses other plugin's "$().distpicker" can follow here.
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Browser support
|
||||||
|
|
||||||
|
- Chrome (latest)
|
||||||
|
- Firefox (latest)
|
||||||
|
- Safari (latest)
|
||||||
|
- Opera (latest)
|
||||||
|
- Edge (latest)
|
||||||
|
- Internet Explorer 9+
|
||||||
|
|
||||||
|
As a jQuery plugin, you also need to see the [jQuery Browser Support](http://jquery.com/browser-support/).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com)
|
||||||
|
|
||||||
|
[⬆ back to top](#table-of-contents)
|
||||||
112
ruoyi-admin/src/main/resources/static/node_modules/distpicker/package.json
generated
vendored
Normal file
112
ruoyi-admin/src/main/resources/static/node_modules/distpicker/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,112 @@
|
||||||
|
{
|
||||||
|
"_from": "distpicker",
|
||||||
|
"_id": "distpicker@2.0.5",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-hMJXkksIm5EpvflpHUb6FHEJEcU=",
|
||||||
|
"_location": "/distpicker",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "tag",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "distpicker",
|
||||||
|
"name": "distpicker",
|
||||||
|
"escapedName": "distpicker",
|
||||||
|
"rawSpec": "",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "latest"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"#USER",
|
||||||
|
"/"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npm.taobao.org/distpicker/download/distpicker-2.0.5.tgz",
|
||||||
|
"_shasum": "84c257924b089b9129bdf9691d46fa14710911c5",
|
||||||
|
"_spec": "distpicker",
|
||||||
|
"_where": "/Users/tangpeng/git/RMS/ruoyi-admin/src/main/resources/static",
|
||||||
|
"author": {
|
||||||
|
"name": "Chen Fengyuan",
|
||||||
|
"url": "https://chenfengyuan.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/fengyuanchen/distpicker/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "A simple jQuery plugin for picking provinces, cities and districts of China.",
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.1.6",
|
||||||
|
"@babel/preset-env": "^7.1.6",
|
||||||
|
"@commitlint/cli": "^7.2.1",
|
||||||
|
"@commitlint/config-conventional": "^7.1.2",
|
||||||
|
"change-case": "^3.0.2",
|
||||||
|
"create-banner": "^1.0.0",
|
||||||
|
"del-cli": "^1.1.0",
|
||||||
|
"eslint": "^5.9.0",
|
||||||
|
"eslint-config-airbnb-base": "^13.1.0",
|
||||||
|
"eslint-plugin-import": "^2.14.0",
|
||||||
|
"husky": "^1.2.0",
|
||||||
|
"jquery": "^3.3.1",
|
||||||
|
"lint-staged": "^8.1.0",
|
||||||
|
"rollup": "^0.67.3",
|
||||||
|
"rollup-plugin-babel": "^4.0.3",
|
||||||
|
"rollup-plugin-commonjs": "^9.2.0",
|
||||||
|
"rollup-plugin-node-resolve": "^3.4.0",
|
||||||
|
"rollup-watch": "^4.3.1",
|
||||||
|
"uglify-js": "^3.4.9"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src",
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"homepage": "https://fengyuanchen.github.io/distpicker",
|
||||||
|
"keywords": [
|
||||||
|
"中国",
|
||||||
|
"省份",
|
||||||
|
"城市",
|
||||||
|
"行政区",
|
||||||
|
"省市区",
|
||||||
|
"三级联动",
|
||||||
|
"地址选择器",
|
||||||
|
"China",
|
||||||
|
"Chinese",
|
||||||
|
"province",
|
||||||
|
"provinces",
|
||||||
|
"city",
|
||||||
|
"cities",
|
||||||
|
"district",
|
||||||
|
"districts",
|
||||||
|
"pick",
|
||||||
|
"picker",
|
||||||
|
"picking",
|
||||||
|
"jquery",
|
||||||
|
"plugin",
|
||||||
|
"jquery-plugin",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"front-end",
|
||||||
|
"web",
|
||||||
|
"development"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "dist/distpicker.common.js",
|
||||||
|
"module": "dist/distpicker.esm.js",
|
||||||
|
"name": "distpicker",
|
||||||
|
"peerDependencies": {
|
||||||
|
"jquery": ">= 1.9.1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/fengyuanchen/distpicker.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "rollup -c",
|
||||||
|
"clear": "del-cli dist",
|
||||||
|
"compress": "uglifyjs dist/distpicker.js -o dist/distpicker.min.js -c -m --comments /^!/",
|
||||||
|
"lint": "eslint src *.js --fix",
|
||||||
|
"release": "npm run clear && npm run lint && npm run build && npm run compress",
|
||||||
|
"start": "rollup -c -m -w"
|
||||||
|
},
|
||||||
|
"unpkg": "dist/distpicker.js",
|
||||||
|
"version": "2.0.5"
|
||||||
|
}
|
||||||
3
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/constants.js
generated
vendored
Normal file
3
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/constants.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export const WINDOW = typeof window !== 'undefined' ? window : {};
|
||||||
|
export const NAMESPACE = 'distpicker';
|
||||||
|
export const EVENT_CHANGE = 'change';
|
||||||
23
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/defaults.js
generated
vendored
Normal file
23
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/defaults.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
export default {
|
||||||
|
// Selects the districts automatically.
|
||||||
|
// 0 -> Disable autoselect
|
||||||
|
// 1 -> Autoselect province only
|
||||||
|
// 2 -> Autoselect province and city only
|
||||||
|
// 3 -> Autoselect all (province, city and district)
|
||||||
|
autoselect: 0,
|
||||||
|
|
||||||
|
// Show placeholder.
|
||||||
|
placeholder: true,
|
||||||
|
|
||||||
|
// Select value. Options: 'name' and 'code'
|
||||||
|
valueType: 'name',
|
||||||
|
|
||||||
|
// Defines the initial value of province.
|
||||||
|
province: '—— 省 ——',
|
||||||
|
|
||||||
|
// Defines the initial value of city.
|
||||||
|
city: '—— 市 ——',
|
||||||
|
|
||||||
|
// Defines the initial value of district.
|
||||||
|
district: '—— 区 ——',
|
||||||
|
};
|
||||||
195
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/distpicker.js
generated
vendored
Normal file
195
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/distpicker.js
generated
vendored
Normal file
|
|
@ -0,0 +1,195 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
import DEFAULTS from './defaults';
|
||||||
|
import DISTRICTS from './districts';
|
||||||
|
import { EVENT_CHANGE } from './constants';
|
||||||
|
|
||||||
|
const DEFAULT_CODE = 100000;
|
||||||
|
const PROVINCE = 'province';
|
||||||
|
const CITY = 'city';
|
||||||
|
const DISTRICT = 'district';
|
||||||
|
|
||||||
|
export default class Distpicker {
|
||||||
|
constructor(element, options) {
|
||||||
|
this.$element = $(element);
|
||||||
|
this.options = $.extend({}, DEFAULTS, $.isPlainObject(options) && options);
|
||||||
|
this.placeholders = $.extend({}, DEFAULTS);
|
||||||
|
this.ready = false;
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
const { options } = this;
|
||||||
|
const $selects = this.$element.find('select');
|
||||||
|
const { length } = $selects;
|
||||||
|
const data = {};
|
||||||
|
|
||||||
|
$selects.each((i, select) => $.extend(data, $(select).data()));
|
||||||
|
|
||||||
|
$.each([PROVINCE, CITY, DISTRICT], (i, type) => {
|
||||||
|
if (data[type]) {
|
||||||
|
options[type] = data[type];
|
||||||
|
this[`$${type}`] = $selects.filter(`[data-${type}]`);
|
||||||
|
} else {
|
||||||
|
this[`$${type}`] = length > i ? $selects.eq(i) : null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.bind();
|
||||||
|
|
||||||
|
// Reset all the selects (after event binding)
|
||||||
|
this.reset();
|
||||||
|
this.ready = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bind() {
|
||||||
|
if (this.$province) {
|
||||||
|
this.$province.on(EVENT_CHANGE, (this.onChangeProvince = $.proxy(() => {
|
||||||
|
this.output(CITY);
|
||||||
|
this.output(DISTRICT, true);
|
||||||
|
}, this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$city) {
|
||||||
|
this.$city.on(
|
||||||
|
EVENT_CHANGE,
|
||||||
|
(this.onChangeCity = $.proxy(() => this.output(DISTRICT, true), this)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unbind() {
|
||||||
|
if (this.$province) {
|
||||||
|
this.$province.off(EVENT_CHANGE, this.onChangeProvince);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$city) {
|
||||||
|
this.$city.off(EVENT_CHANGE, this.onChangeCity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output(type, triggerEvent = false) {
|
||||||
|
const { options, placeholders } = this;
|
||||||
|
const $select = this[`$${type}`];
|
||||||
|
|
||||||
|
if (!$select || !$select.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let code;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PROVINCE:
|
||||||
|
code = DEFAULT_CODE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CITY:
|
||||||
|
code = this.$province && (this.$province.find(':selected').data('code') || '');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DISTRICT:
|
||||||
|
code = this.$city && (this.$city.find(':selected').data('code') || '');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const districts = this.getDistricts(code);
|
||||||
|
const value = options[type];
|
||||||
|
const data = [];
|
||||||
|
let matched = false;
|
||||||
|
|
||||||
|
if ($.isPlainObject(districts)) {
|
||||||
|
$.each(districts, (i, name) => {
|
||||||
|
const selected = name === value || i === String(value);
|
||||||
|
|
||||||
|
if (selected) {
|
||||||
|
matched = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.push({
|
||||||
|
name,
|
||||||
|
selected,
|
||||||
|
code: i,
|
||||||
|
value: options.valueType === 'name' ? name : i,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!matched) {
|
||||||
|
const autoselect = options.autoselect || options.autoSelect;
|
||||||
|
|
||||||
|
if (data.length && ((type === PROVINCE && autoselect > 0)
|
||||||
|
|| (type === CITY && autoselect > 1)
|
||||||
|
|| (type === DISTRICT && autoselect > 2))) {
|
||||||
|
data[0].selected = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the unmatched value as a placeholder at the first output
|
||||||
|
if (!this.ready && value) {
|
||||||
|
placeholders[type] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add placeholder option
|
||||||
|
if (options.placeholder) {
|
||||||
|
data.unshift({
|
||||||
|
code: '',
|
||||||
|
name: placeholders[type],
|
||||||
|
value: '',
|
||||||
|
selected: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.length) {
|
||||||
|
$select.html(this.getList(data));
|
||||||
|
} else {
|
||||||
|
$select.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerEvent) {
|
||||||
|
$select.trigger(EVENT_CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
|
getList(data) {
|
||||||
|
const list = [];
|
||||||
|
|
||||||
|
$.each(data, (i, n) => {
|
||||||
|
const attrs = [
|
||||||
|
`data-code="${n.code}"`,
|
||||||
|
`data-text="${n.name}"`,
|
||||||
|
`value="${n.value}"`,
|
||||||
|
];
|
||||||
|
|
||||||
|
if (n.selected) {
|
||||||
|
attrs.push('selected');
|
||||||
|
}
|
||||||
|
|
||||||
|
list.push(`<option ${attrs.join(' ')}>${n.name}</option>`);
|
||||||
|
});
|
||||||
|
|
||||||
|
return list.join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
|
getDistricts(code = DEFAULT_CODE) {
|
||||||
|
return DISTRICTS[code] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
reset(deep) {
|
||||||
|
if (!deep) {
|
||||||
|
this.output(PROVINCE);
|
||||||
|
this.output(CITY);
|
||||||
|
this.output(DISTRICT);
|
||||||
|
} else if (this.$province) {
|
||||||
|
this.$province.find(':first').prop('selected', true).end().trigger(EVENT_CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy() {
|
||||||
|
this.unbind();
|
||||||
|
}
|
||||||
|
|
||||||
|
static setDefaults(options) {
|
||||||
|
$.extend(DEFAULTS, $.isPlainObject(options) && options);
|
||||||
|
}
|
||||||
|
}
|
||||||
4105
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/districts.js
generated
vendored
Normal file
4105
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/districts.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
59
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/index.js
generated
vendored
Normal file
59
ruoyi-admin/src/main/resources/static/node_modules/distpicker/src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
import Distpicker from './distpicker';
|
||||||
|
import {
|
||||||
|
NAMESPACE,
|
||||||
|
WINDOW,
|
||||||
|
} from './constants';
|
||||||
|
|
||||||
|
if ($.fn) {
|
||||||
|
const AnotherDistpicker = $.fn.distpicker;
|
||||||
|
|
||||||
|
$.fn.distpicker = function jQueryDistpicker(option, ...args) {
|
||||||
|
let result;
|
||||||
|
|
||||||
|
this.each((i, element) => {
|
||||||
|
const $element = $(element);
|
||||||
|
const isDestroy = option === 'destroy';
|
||||||
|
let distpicker = $element.data(NAMESPACE);
|
||||||
|
|
||||||
|
if (!distpicker) {
|
||||||
|
if (isDestroy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const options = $.extend({}, $element.data(), $.isPlainObject(option) && option);
|
||||||
|
|
||||||
|
distpicker = new Distpicker(element, options);
|
||||||
|
$element.data(NAMESPACE, distpicker);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof option === 'string') {
|
||||||
|
const fn = distpicker[option];
|
||||||
|
|
||||||
|
if ($.isFunction(fn)) {
|
||||||
|
result = fn.apply(distpicker, args);
|
||||||
|
|
||||||
|
if (isDestroy) {
|
||||||
|
$element.removeData(NAMESPACE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return typeof result === 'undefined' ? this : result;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.distpicker.Constructor = Distpicker;
|
||||||
|
$.fn.distpicker.setDefaults = Distpicker.setDefaults;
|
||||||
|
|
||||||
|
$.fn.distpicker.noConflict = function noConflict() {
|
||||||
|
$.fn.distpicker = AnotherDistpicker;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WINDOW.document) {
|
||||||
|
$(() => {
|
||||||
|
$(`[data-toggle="${NAMESPACE}"]`).distpicker();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"requires": true,
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"dependencies": {
|
||||||
|
"distpicker": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/distpicker/download/distpicker-2.0.5.tgz",
|
||||||
|
"integrity": "sha1-hMJXkksIm5EpvflpHUb6FHEJEcU="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -36,26 +36,16 @@
|
||||||
<input id="country" name="country" class="form-control" type="text">
|
<input id="country" name="country" class="form-control" type="text">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" data-toggle="distpicker"><!-- container -->
|
||||||
<label class="col-sm-3 control-label">所在省:</label>
|
<label class="col-sm-3 control-label">省市区:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="province" name="province" class="form-control" type="text">
|
<select id="province" name="province" data-province="---- 选择省 ----"></select>
|
||||||
|
<select id="city" name="city" data-city="---- 选择市 ----"></select>
|
||||||
|
<select id="area" name="area" data-district="---- 选择区 ----"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">所在市:</label>
|
<label class="col-sm-3 control-label">详细地址:</label>
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="city" name="city" class="form-control" type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">所在区:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="area" name="area" class="form-control" type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">地址:</label>
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="location" name="location" class="form-control" type="text">
|
<input id="location" name="location" class="form-control" type="text">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -130,20 +130,29 @@
|
||||||
title: '所在国家',
|
title: '所在国家',
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// field: 'province',
|
||||||
|
// title: '所在省',
|
||||||
|
// sortable: true
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// field: 'city',
|
||||||
|
// title: '所在市',
|
||||||
|
// sortable: true
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// field: 'area',
|
||||||
|
// title: '所在区',
|
||||||
|
// sortable: true
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
field: 'province',
|
title: '省市区',
|
||||||
title: '所在省',
|
formatter: function (value, row, index) {
|
||||||
sortable: true
|
if (row) {
|
||||||
},
|
value = row.province + row.city + row.area;
|
||||||
{
|
}
|
||||||
field: 'city',
|
return value;
|
||||||
title: '所在市',
|
}
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'area',
|
|
||||||
title: '所在区',
|
|
||||||
sortable: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'location',
|
field: 'location',
|
||||||
|
|
|
||||||
|
|
@ -40,22 +40,12 @@
|
||||||
<input id="country" name="country" th:field="*{country}" class="form-control" type="text">
|
<input id="country" name="country" th:field="*{country}" class="form-control" type="text">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" data-toggle="distpicker"><!-- container -->
|
||||||
<label class="col-sm-3 control-label">所在省:</label>
|
<label class="col-sm-3 control-label">省市区:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="province" name="province" th:field="*{province}" class="form-control" type="text">
|
<select id="province" name="province" th:field="*{province}" data-province="---- 选择省 ----"></select>
|
||||||
</div>
|
<select id="city" name="city" th:field="*{city}" data-city="---- 选择市 ----"></select>
|
||||||
</div>
|
<select id="area" name="area" th:field="*{area}" data-district="---- 选择区 ----"></select>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">所在市:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="city" name="city" th:field="*{city}" class="form-control" type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">所在区:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="area" name="area" th:field="*{area}" class="form-control" type="text">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
@ -141,6 +131,18 @@
|
||||||
$.operate.save(prefix + "/edit", $('#form-assetsMachineRoom-edit').serialize());
|
$.operate.save(prefix + "/edit", $('#form-assetsMachineRoom-edit').serialize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 修改时手动回显省市区
|
||||||
|
*/
|
||||||
|
$(function () {
|
||||||
|
var machineRoom = [[${assetsMachineRoom}]];
|
||||||
|
$("#province").val(machineRoom.province);
|
||||||
|
$("#province").trigger("change");
|
||||||
|
$("#city").val(machineRoom.city);
|
||||||
|
$("#city").trigger("change");
|
||||||
|
$("#area").val(machineRoom.area);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
|
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
|
||||||
<script th:src="@{/ruoyi/js/common.js?v=3.4.0}"></script>
|
<script th:src="@{/ruoyi/js/common.js?v=3.4.0}"></script>
|
||||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=3.4.0}"></script>
|
<script th:src="@{/ruoyi/js/ry-ui.js?v=3.4.0}"></script>
|
||||||
|
<script th:src="@{/node_modules/distpicker/dist/distpicker.js}"></script>
|
||||||
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
|
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue