@ -6,7 +6,7 @@
< th:block th:include = "include :: ztree-css" / >
< / head >
< body class = "gray-bg" >
< div class = "ui-layout-center" >
< div class = "ui-layout-center" id = "app" >
< div class = "container-div" >
< div class = "row" >
< div class = "col-sm-12 search-collapse" >
@ -21,11 +21,21 @@
< / li >
< li >
< label > 所属市州:< / label >
< input type = "text" name = "framework" / >
< select id = "City" name = "framework" @ change = "getAreaList()" v-model = "City" >
< option value = "" > 请选择< / option >
< option v-for = "option in CityList" :value = "option.id" :key = "option.id" >
{{ option.name }}
< / option >
< / select >
< / li >
< li >
< label > 所属区县:< / label >
< input type = "text" name = "area" / >
< select id = "Area" name = "area" v-model = "Area" >
< option value = "" > 请选择< / option >
< option v-for = "option in AreaList" :value = "option.id" :key = "option.id" >
{{ option.name }}
< / option >
< / select >
< / li >
< li >
< a class = "btn btn-primary btn-rounded btn-sm" onclick = "$.table.search()" > < i class = "fa fa-search" > < / i > 搜索< / a >
@ -57,7 +67,15 @@
var shemichengdu = [[${@dict.getType('sys_user_shemi')}]];
var examineState = [[${@dict.getType('sys_examine_state')}]];
var prefix = ctx + "system/usernum";
let datas = []
$.ajax({
url: ctx + "system/area/getAllList",
type: 'GET',
data:{parentId:''} ,
success:((res)=>{
datas = res.data
}) ,
});
$(function() {
var panehHidden = false;
if ($(this).width() < 769 ) {
@ -95,11 +113,17 @@
},
{
field: 'dept.framework',
title: '所属市州'
title: '所属市州',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'dept.area',
title: '所属区县'
title: '所属区县',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'dept.deptName',
@ -130,7 +154,48 @@
$(".curSelectedNode").removeClass("curSelectedNode");
$.table.search();
}
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:'',
Area:'',
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
if (this.City){
this.getAreaList()
}
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
getAreaList(){
this.params.parentId = this.City
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params,
success:((res)=>{
this.AreaList = res.data
}) ,
});
}
}
})
/* 用户管理-部门 */
function dept() {
var url = ctx + "system/dept";