diff --git a/module-institution-management/pom.xml b/module-institution-management/pom.xml index d69b815..a3b6b01 100644 --- a/module-institution-management/pom.xml +++ b/module-institution-management/pom.xml @@ -18,6 +18,13 @@ interface-institution-management 1.0-SNAPSHOT + + ink.wgink + module-dictionary + 1.0-SNAPSHOT + compile + + diff --git a/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml b/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml index d8c6126..522c580 100644 --- a/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml +++ b/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml @@ -317,7 +317,7 @@ AND ( - t1.id LIKE CONCAT('%', #{keywords}, '%') + t1.institution_name LIKE CONCAT('%', #{keywords}, '%') ) @@ -335,6 +335,7 @@ #{institutionIds[${index}]} + ORDER BY t1.gmt_create DESC @@ -367,7 +368,7 @@ AND ( - t1.id LIKE CONCAT('%', #{keywords}, '%') + t1.institution_name LIKE CONCAT('%', #{keywords}, '%') ) @@ -385,6 +386,7 @@ #{institutionIds[${index}]} + ORDER BY t1.gmt_create DESC @@ -417,7 +419,7 @@ AND ( - t1.id LIKE CONCAT('%', #{keywords}, '%') + t1.institution_name LIKE CONCAT('%', #{keywords}, '%') ) @@ -435,6 +437,7 @@ #{institutionIds[${index}]} + ORDER BY t1.gmt_create DESC diff --git a/module-institution-management/src/main/resources/templates/institution/list.html b/module-institution-management/src/main/resources/templates/institution/list.html index e3dcd0e..eb960f3 100644 --- a/module-institution-management/src/main/resources/templates/institution/list.html +++ b/module-institution-management/src/main/resources/templates/institution/list.html @@ -9,6 +9,7 @@ +
@@ -86,6 +87,26 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, + {field: 'institutionImage', width: 180, title: '机构图片', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + var value=''; + setTimeout(function() { + new Viewer(document.getElementById("viewer"),{ + loop:true + }); + }, 50); + return value; + } + }, {field: 'institutionName', width: 180, title: '机构名称', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -104,24 +125,7 @@ return rowData; } }, - {field: 'institutionImage', width: 180, title: '机构图片', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - var downloadFile = ''; - var datas = rowData.split(','); - for(var i = 0, item = datas[i]; item = datas[i++];) { - if(downloadFile.length > 0) { - downloadFile += ' | '; - } - downloadFile += '点击下载' - } - return downloadFile; - } - }, - {field: 'institutionAddress', width: 180, title: '机构详情地址', align:'center', + {field: 'institutionAddress', width: 350, title: '机构详情地址', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -157,69 +161,6 @@ return rowData; } }, - {field: 'institutionRegionProvince', width: 180, title: '行政区划-省', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'institutionRegionCity', width: 180, title: '行政区化-市', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'institutionRegionArea', width: 180, title: '行政区化-区', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'institutionRegionVillage', width: 180, title: '行政区化-村', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'institutionRegionStreet', width: 180, title: '行政区化-街', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'creator', width: 180, title: '', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'gmtCreate', width: 180, title: '', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, ] ], page: true, diff --git a/module-institution-management/src/main/resources/templates/institution/save.html b/module-institution-management/src/main/resources/templates/institution/save.html index 588acbb..2bf6464 100644 --- a/module-institution-management/src/main/resources/templates/institution/save.html +++ b/module-institution-management/src/main/resources/templates/institution/save.html @@ -12,10 +12,16 @@ @@ -72,14 +78,6 @@
-
- -
- - - -
-
@@ -101,31 +99,44 @@
-
-
-
- +
-
+
+ +
+ + + +
+
+
+
+
+
+
+ @@ -155,6 +167,7 @@ var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + var dictId = 'cce46439-d5de-4687-8a9b-cb22817daad5'; function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); @@ -276,6 +289,8 @@ function initData() { initInstitutionImageUploadFile(); initInstitutionFoundingTimeDateTime(); + initMap('109.85017859252311', '40.66017700460503'); + initDataDict(dictId,'institutionRegionProvince'); } initData(); @@ -312,20 +327,86 @@ closeBox(); }); - - $("#institutionAddress").on('click',function () { - layer.open({ - type: 2, - title: false, - closeBtn: 0, - area: ['50%', '50%'], - shadeClose: true, - anim: 2, - content: top.restAjax.path('route/institution/baidumap', []), - end: function() { - - } + //初始化百度地图 + function initMap(longitude, latitude) { + map = new BMap.Map("mapContainer", {enableMapClick: false,}); + var point = new BMap.Point(longitude, latitude); + map.centerAndZoom(point, 13); + map.disableDoubleClickZoom(); + map.addControl(new BMap.NavigationControl()); + map.addControl(new BMap.ScaleControl()); + map.addControl(new BMap.OverviewMapControl()); + map.addControl(new BMap.MapTypeControl()); + map.enableScrollWheelZoom();//启用地图滚轮放大缩小 + map.enableContinuousZoom();//开启缩放平滑 + // 点击获取地址 + var geocoder= new BMap.Geocoder(); + mapMarkPoint(map, point); + map.addEventListener("click", function(e) { + map.clearOverlays(); + $('#institutionX').val(e.point.lng); + $('#institutionY').val(e.point.lat); + point = new BMap.Point(e.point.lng, e.point.lat); + mapMarkPoint(map, point); + geocoder.getLocation(e.point, function(rs) { + $('#institutionAddress').val(rs.address); + }); }); + } + //地图标点 + function mapMarkPoint(map, point) { + var marker = new BMap.Marker(point); + map.addOverlay(marker); + } + + //c初始化数据字典 + function initDataDict(dictId,tabId){ + top.restAjax.get(top.restAjax.path("api/data/listbyparentid/{dataParentId}",[dictId]),{},null,function (code,data,args) { + $("#"+tabId).empty(); + var html = ''; + if ('institutionRegionProvince' === tabId){ + html += ''; + } + if ('institutionRegionCity' === tabId){ + html += ''; + } + if ('institutionRegionArea' === tabId){ + html += ''; + } + if ('institutionRegionVillage' === tabId){ + html += ''; + } + if ('institutionRegionStreet' === tabId){ + html += ''; + } + + $.each(data, function (index, item) { + html += ''; + }); + $("#"+tabId).append(html); + form.render('select'); + }); + } + + //省监听事件 + form.on('select(institutionRegionProvince)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionCity'); + }); + //市监听事件 + form.on('select(institutionRegionCity)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionArea'); + }); + //区监听事件 + form.on('select(institutionRegionArea)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionVillage'); + }); + //镇、村监听事件 + form.on('select(institutionRegionVillage)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionStreet'); }); // 校验 diff --git a/module-institution-management/src/main/resources/templates/institution/update.html b/module-institution-management/src/main/resources/templates/institution/update.html index 9dbb122..3e1f3ee 100644 --- a/module-institution-management/src/main/resources/templates/institution/update.html +++ b/module-institution-management/src/main/resources/templates/institution/update.html @@ -10,6 +10,20 @@ +
@@ -64,24 +78,6 @@
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
@@ -101,33 +97,44 @@
- -
- + +
+ +
+
+ +
+
+ +
+
+ +
+
+
- +
- + + +
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+
+
@@ -142,6 +149,7 @@
+ @@ -157,6 +165,7 @@ var laytpl = layui.laytpl; var laydate = layui.laydate; var institutionId = top.restAjax.params(window.location.href).institutionId; + var dictId = 'cce46439-d5de-4687-8a9b-cb22817daad5'; var wangEditor = window.wangEditor; var wangEditorObj = {}; @@ -269,11 +278,11 @@ } // 初始化机构成立时间时间戳 - function initInstitutionFoundingTimeDateTime() { + function initInstitutionFoundingTimeDateTime(v) { laydate.render({ elem: '#institutionFoundingTime', type: 'datetime', - value: new Date(), + value: v, trigger: 'click' }); } @@ -290,7 +299,13 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initInstitutionImageUploadFile(); - initInstitutionFoundingTimeDateTime(); + initInstitutionFoundingTimeDateTime(data.institutionFoundingTime); + initMap(data.institutionX,data.institutionY); + initDataDict(dictId,'institutionRegionProvince',data.institutionRegionProvince); + initDataDict(data.institutionRegionProvince,'institutionRegionCity',data.institutionRegionCity); + initDataDict(data.institutionRegionCity,'institutionRegionArea',data.institutionRegionArea); + initDataDict(data.institutionRegionArea,'institutionRegionVillage',data.institutionRegionVillage); + initDataDict(data.institutionRegionVillage,'institutionRegionStreet',data.institutionRegionStreet); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -334,6 +349,99 @@ closeBox(); }); + + //初始化百度地图 + function initMap(longitude, latitude) { + map = new BMap.Map("mapContainer", {enableMapClick: false,}); + var point = new BMap.Point(longitude, latitude); + map.centerAndZoom(point, 13); + map.disableDoubleClickZoom(); + map.addControl(new BMap.NavigationControl()); + map.addControl(new BMap.ScaleControl()); + map.addControl(new BMap.OverviewMapControl()); + map.addControl(new BMap.MapTypeControl()); + map.enableScrollWheelZoom();//启用地图滚轮放大缩小 + map.enableContinuousZoom();//开启缩放平滑 + // 点击获取地址 + var geocoder= new BMap.Geocoder(); + mapMarkPoint(map, point); + map.addEventListener("click", function(e) { + map.clearOverlays(); + $('#institutionX').val(e.point.lng); + $('#institutionY').val(e.point.lat); + point = new BMap.Point(e.point.lng, e.point.lat); + mapMarkPoint(map, point); + geocoder.getLocation(e.point, function(rs) { + $('#institutionAddress').val(rs.address); + }); + }); + } + //地图标点 + function mapMarkPoint(map, point) { + var marker = new BMap.Marker(point); + map.addOverlay(marker); + } + + + //c初始化数据字典 + function initDataDict(dictId,tabId,selectVelue){ + if(dictId == null || dictId == ''){ + return; + } + top.restAjax.get(top.restAjax.path("api/data/listbyparentid/{dataParentId}",[dictId]),{},null,function (code,data,args) { + $("#"+tabId).empty(); + var html = ''; + if ('institutionRegionProvince' === tabId){ + html += ''; + } + if ('institutionRegionCity' === tabId){ + html += ''; + } + if ('institutionRegionArea' === tabId){ + html += ''; + } + if ('institutionRegionVillage' === tabId){ + html += ''; + } + if ('institutionRegionStreet' === tabId){ + html += ''; + } + + $.each(data, function (index, item) { + if(selectVelue == item.dataId){ + html += ''; + }else{ + html += ''; + } + }); + $("#"+tabId).append(html); + form.render('select'); + }); + } + + //省监听事件 + form.on('select(institutionRegionProvince)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionCity'); + }); + //市监听事件 + form.on('select(institutionRegionCity)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionArea'); + }); + //区监听事件 + form.on('select(institutionRegionArea)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionVillage'); + }); + //镇、村监听事件 + form.on('select(institutionRegionVillage)', function(data){ + var v = data.value; + initDataDict(v,'institutionRegionStreet'); + }); + + + // 校验 form.verify({ }); diff --git a/module-organization-management/src/main/resources/templates/organization/list.html b/module-organization-management/src/main/resources/templates/organization/list.html index 76aafbc..8585685 100644 --- a/module-organization-management/src/main/resources/templates/organization/list.html +++ b/module-organization-management/src/main/resources/templates/organization/list.html @@ -9,6 +9,7 @@ +
@@ -86,6 +87,26 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, + {field: 'organizationImage', width: 180, title: '组织图片', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + var value='
    '; + var datas = rowData.split(','); + for(var i = 0, item = datas[i]; item = datas[i++];) { + value += '
  • 图片1
  • '; + } + value += '
'; + setTimeout(function() { + new Viewer(document.getElementById("viewer"),{ + loop:true + }); + }, 50); + return value; + } + }, {field: 'organizationName', width: 180, title: '组织名称', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -122,41 +143,7 @@ return rowData; } }, - {field: 'organizationImage', width: 180, title: '组织图片', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - var downloadFile = ''; - var datas = rowData.split(','); - for(var i = 0, item = datas[i]; item = datas[i++];) { - if(downloadFile.length > 0) { - downloadFile += ' | '; - } - downloadFile += '点击下载' - } - return downloadFile; - } - }, - {field: '创建人', width: 180, title: '', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: '创建时间', width: 180, title: '', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, + ] ], page: true, diff --git a/module-organization-management/src/main/resources/templates/organization/save.html b/module-organization-management/src/main/resources/templates/organization/save.html index a74efad..662c13a 100644 --- a/module-organization-management/src/main/resources/templates/organization/save.html +++ b/module-organization-management/src/main/resources/templates/organization/save.html @@ -10,6 +10,20 @@ +
diff --git a/module-organization-management/src/main/resources/templates/organization/update.html b/module-organization-management/src/main/resources/templates/organization/update.html index f6a56d2..1fce0ac 100644 --- a/module-organization-management/src/main/resources/templates/organization/update.html +++ b/module-organization-management/src/main/resources/templates/organization/update.html @@ -10,6 +10,20 @@ +