From 862b585f0426b8eff0a5fbb676e067123ed5f108 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Fri, 31 May 2024 08:58:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=99=BB=E8=AE=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=9B=B4=E6=94=B9=E5=9C=B0=E5=8C=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/getCity.js | 16 ++++ .../src/main/resources/templates/include.html | 1 + .../templates/system/fileprovide/add.html | 61 +++++++++++++-- .../system/fileprovide/fileprovide.html | 50 ++++++++++++- .../system/property/property/add.html | 61 +++++++++++++-- .../system/property/property/edit.html | 61 +++++++++++++-- .../system/property/property/property.html | 75 +++++++++++++++++-- 7 files changed, 299 insertions(+), 26 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/static/ruoyi/js/getCity.js diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/getCity.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/getCity.js new file mode 100644 index 0000000..3e63d90 --- /dev/null +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/getCity.js @@ -0,0 +1,16 @@ +function getCity(datas,value){ + if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { + return ''; + } + var actions = [] + $.each(datas, function(index, city) { + if (city.id === ('' + value)) { + actions.push($.common.sprintf("%s", city.name)); + return false; + } + }); + if (actions.length === 0) { + actions.push($.common.sprintf("%s", value)) + } + return actions.join(''); +} diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index 894cc5f..5233317 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -39,6 +39,7 @@ + diff --git a/ruoyi-admin/src/main/resources/templates/system/fileprovide/add.html b/ruoyi-admin/src/main/resources/templates/system/fileprovide/add.html index dce45cf..9982156 100644 --- a/ruoyi-admin/src/main/resources/templates/system/fileprovide/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/fileprovide/add.html @@ -7,18 +7,28 @@ -
+
- +
- +
- +
@@ -115,7 +125,48 @@ $("#form-fileprovide-add").validate({ focusCleanup: true }); - + 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 submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-fileprovide-add').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/system/fileprovide/fileprovide.html b/ruoyi-admin/src/main/resources/templates/system/fileprovide/fileprovide.html index b058bdf..ec1a655 100644 --- a/ruoyi-admin/src/main/resources/templates/system/fileprovide/fileprovide.html +++ b/ruoyi-admin/src/main/resources/templates/system/fileprovide/fileprovide.html @@ -4,7 +4,7 @@ -
+
@@ -23,7 +23,12 @@
  • - +
  • @@ -58,7 +63,15 @@ var instancyExtentDatas = [[${@dict.getType('sys_file_jinjichengdu')}]]; var fileSecretDatas = [[${@dict.getType('sys_file_miji')}]]; var prefix = ctx + "system/fileprovide"; - + let datas = [] + $.ajax({ + url: ctx + "system/area/getAllList", + type: 'GET', + data:{parentId:''} , + success:((res)=>{ + datas = res.data + }) , + }); $(function() { var options = { url: prefix + "/list", @@ -103,7 +116,10 @@ }, { field: 'frameworkId', - title: '所属地区' + title: '所属地区', + formatter: function(value, row, index) { + return getCity(datas, value) + } }, { field: 'fileSecret', @@ -125,6 +141,32 @@ }; $.table.init(options); }); + var app = new Vue({ + el: '#app', + data: { + CityList: [], + City:'', + params:{ + parentId:'', + } + }, + mounted(){ + // 初始化地市列表 + this.getCityList(); + }, + methods:{ + getCityList(){ + $.ajax({ + url: ctx + "system/area/getSysAreaList", + type: 'GET', + data:this.params , + success:((res)=>{ + this.CityList = res.data + }) , + }); + }, + } + }) diff --git a/ruoyi-admin/src/main/resources/templates/system/property/property/add.html b/ruoyi-admin/src/main/resources/templates/system/property/property/add.html index 618c37a..e43643c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/property/property/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/property/property/add.html @@ -5,18 +5,28 @@ -
    +
    - +
    - +
    - +
    @@ -82,7 +92,48 @@ $("#form-property-add").validate({ focusCleanup: true }); - + 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 submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-property-add').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/system/property/property/edit.html b/ruoyi-admin/src/main/resources/templates/system/property/property/edit.html index b3443fd..2c628c4 100644 --- a/ruoyi-admin/src/main/resources/templates/system/property/property/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/property/property/edit.html @@ -5,7 +5,7 @@ -
    +
    @@ -63,15 +63,25 @@
    - +
    - +
    - +
    @@ -89,7 +99,48 @@ $("#form-property-edit").validate({ focusCleanup: true }); - + var app = new Vue({ + el: '#app', + data: { + CityList: [], + AreaList:[], + City:[[${tdPropertyManager.part}]], + Area:[[${tdPropertyManager.areaId}]], + 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 submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-property-edit').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/system/property/property/property.html b/ruoyi-admin/src/main/resources/templates/system/property/property/property.html index 2a79c7b..6444bd6 100644 --- a/ruoyi-admin/src/main/resources/templates/system/property/property/property.html +++ b/ruoyi-admin/src/main/resources/templates/system/property/property/property.html @@ -4,7 +4,7 @@ -
    +
    @@ -19,8 +19,13 @@
  • - - + +
  •  搜索 @@ -56,7 +61,15 @@ var removeFlag = [[${@permission.hasPermi('system:property:remove')}]]; var listFlag = [[${@permission.hasPermi('system:property:list')}]]; var prefix = ctx + "system/property"; - + let datas = [] + $.ajax({ + url: ctx + "system/area/getAllList", + type: 'GET', + data:{parentId:''} , + success:((res)=>{ + datas = res.data + }) , + }); $(function() { var options = { url: prefix + "/list", @@ -74,11 +87,17 @@ }, { field: 'part', - title: '所属市州' + title: '所属市州', + formatter: function(value, row, index) { + return getCity(datas, value) + } }, { field: 'areaId', - title: '所属区县' + title: '所属区县', + formatter: function(value, row, index) { + return getCity(datas, value) + } }, { field: 'useDepart', @@ -110,6 +129,48 @@ }; $.table.init(options); }); + 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 detail(useId) { var url = prefix + '/detail/' + useId; @@ -117,4 +178,4 @@ } - \ No newline at end of file +