From 89dc613f74e52fca90c0e5a0e86cb5d43de73c82 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Fri, 31 May 2024 08:44:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=89=E5=AF=86=E7=BD=91=E7=BB=9C=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=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 --- .../templates/system/network/network/add.html | 61 +++++++++++- .../system/network/network/edit.html | 61 +++++++++++- .../system/network/network/network.html | 96 +++++++++++++++++-- 3 files changed, 201 insertions(+), 17 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/network/network/add.html b/ruoyi-admin/src/main/resources/templates/system/network/network/add.html index 9fedc36..4c1d082 100644 --- a/ruoyi-admin/src/main/resources/templates/system/network/network/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/network/network/add.html @@ -5,18 +5,28 @@ -
+
- +
- +
- +
@@ -75,7 +85,48 @@ $.operate.save(prefix + "/add", $('#form-network-add').serialize()); } } - + 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 + }) , + }); + } + } + }) $("input[name='netDate']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", diff --git a/ruoyi-admin/src/main/resources/templates/system/network/network/edit.html b/ruoyi-admin/src/main/resources/templates/system/network/network/edit.html index 0aa9f56..d49a265 100644 --- a/ruoyi-admin/src/main/resources/templates/system/network/network/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/network/network/edit.html @@ -5,19 +5,29 @@ -
+
- +
- +
- +
@@ -71,7 +81,48 @@ $("#form-network-edit").validate({ focusCleanup: true }); - + var app = new Vue({ + el: '#app', + data: { + CityList: [], + AreaList:[], + City:[[${tdPropertyNet.framework}]], + Area:[[${tdPropertyNet.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 + "/edit", $('#form-network-edit').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/system/network/network/network.html b/ruoyi-admin/src/main/resources/templates/system/network/network/network.html index 2b798b2..0e7ffb5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/network/network/network.html +++ b/ruoyi-admin/src/main/resources/templates/system/network/network/network.html @@ -4,7 +4,7 @@ -
+
@@ -12,11 +12,21 @@
  • - +
  • - +
  • @@ -61,7 +71,15 @@ var listFlag = [[${@permission.hasPermi('system:network:list')}]]; var netMijiDatas = [[${@dict.getType('sys_file_miji')}]]; var prefix = ctx + "system/network"; - + let datas = [] + $.ajax({ + url: ctx + "system/area/getAllList", + type: 'GET', + data:{parentId:''} , + success:((res)=>{ + datas = res.data + }) , + }); $(function() { var options = { url: prefix + "/list", @@ -80,11 +98,17 @@ }, { field: 'framework', - title: '所属市州' + title: '所属市州', + formatter: function(value, row, index) { + return getCity(datas, value) + } }, { field: 'area', - title: '所属区县' + title: '所属区县', + formatter: function(value, row, index) { + return getCity(datas, value) + } }, { field: 'netDepart', @@ -127,11 +151,69 @@ }; $.table.init(options); }); + 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(''); + } /*网络设备列表-详细*/ function detail(netId) { var url = prefix + '/detail/' + netId; $.modal.openTab("网络设备列表数据", url); } + 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 + }) , + }); + } + } + }) - \ No newline at end of file +