From a8b69a49479fabf0bf4977dfd2f5a6e86a809f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Fri, 2 Jun 2023 15:26:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=B3=E5=B1=B1=E5=86=9C=E6=9D=91=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoport/index.html | 4 ++-- infoport/static/css/index.css | 3 ++- infoport/static/js/project/homestead.js | 20 +++++++++++++++++--- infoport/static/js/project/index.js | 7 +++++++ infoport/static/js/project/property.js | 21 ++++++++++++++++----- infoport/static/js/project/resource.js | 20 +++++++++++++++++--- 6 files changed, 61 insertions(+), 14 deletions(-) diff --git a/infoport/index.html b/infoport/index.html index 8b7d431..2865da0 100644 --- a/infoport/index.html +++ b/infoport/index.html @@ -60,7 +60,7 @@
@@ -81,7 +81,7 @@

今日资讯

-

2023.03.15

+

2023.03.15

diff --git a/infoport/static/css/index.css b/infoport/static/css/index.css index 95de9f9..bbaab7c 100644 --- a/infoport/static/css/index.css +++ b/infoport/static/css/index.css @@ -152,7 +152,7 @@ border-radius: 15px; padding: 3vh; display: flex; - align-items: center; + /*align-items: center;*/ } .personalTit-banner { @@ -165,6 +165,7 @@ .new_list{ margin-left: 2%; width: 53%; + padding: 1vh 0; } .new_list_tit{ diff --git a/infoport/static/js/project/homestead.js b/infoport/static/js/project/homestead.js index 6b44855..0f292a0 100644 --- a/infoport/static/js/project/homestead.js +++ b/infoport/static/js/project/homestead.js @@ -14,7 +14,11 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function treeselectSecond:[{ value:100, label:'全部' - }] + }], + useType:[{ + dictValue:'', + dictLabel:'全部' + }], }, }; var tools = new Tools(); @@ -39,7 +43,10 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function module.webDeptType = function (data) { if (data.code == 200) { var content = data.data; - module.data.useType = content; + content.map(res=>{ + module.data.useType.push(res) + }) + // module.data.useType = content; var useTypeData = template('useTypeData', module.data); $("#useTypeContent").html(useTypeData); } @@ -131,7 +138,14 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function selectChange = function(){ // tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.selectSecondChange , true); - module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; + if ($('#treeselectContent').val() == 100){ + module.data.treeselectSecond = [{ + value:100, + label:'全部' + }] + }else{ + module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; + } var treeselectSecondData = template('treeselectSecondData', module.data); $("#treeselectSecondContent").html(treeselectSecondData); diff --git a/infoport/static/js/project/index.js b/infoport/static/js/project/index.js index 12631c6..3fcde94 100644 --- a/infoport/static/js/project/index.js +++ b/infoport/static/js/project/index.js @@ -24,6 +24,9 @@ define(['jquery', "template", "Tools", 'swiper'], function ($, template, Tools, autoplay : 2000, loop:true }) + + $("#nowDateNYR").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate()); + }; module.newsList = function (data) { @@ -46,5 +49,9 @@ define(['jquery', "template", "Tools", 'swiper'], function ($, template, Tools, } } + searchChange = function () { + tools.doGet(newsList, {pageNum:1,pageSize:8,infoName:$("#searchInput").val()}, module.newsList , true); + } + return module; }); \ No newline at end of file diff --git a/infoport/static/js/project/property.js b/infoport/static/js/project/property.js index fda4a2f..198785a 100644 --- a/infoport/static/js/project/property.js +++ b/infoport/static/js/project/property.js @@ -13,7 +13,11 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function treeselectSecond:[{ value:100, label:'全部' - }] + }], + useType:[{ + dictValue:'', + dictLabel:'全部' + }], }, }; var tools = new Tools(); @@ -41,7 +45,9 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function module.webDeptType = function (data) { if (data.code == 200) { var content = data.data; - module.data.useType = content; + content.map(res=>{ + module.data.useType.push(res) + }) var useTypeData = template('useTypeData', module.data); $("#useTypeContent").html(useTypeData); } @@ -133,10 +139,15 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function selectChange = function(){ // tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.selectSecondChange , true); - if ($('#treeselectContent').val() == ''){ - + console.log($('#treeselectContent').val()) + if ($('#treeselectContent').val() == 100){ + module.data.treeselectSecond = [{ + value:100, + label:'全部' + }] + }else{ + module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; } - module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; var treeselectSecondData = template('treeselectSecondData', module.data); $("#treeselectSecondContent").html(treeselectSecondData); diff --git a/infoport/static/js/project/resource.js b/infoport/static/js/project/resource.js index b7f24b7..7b59db4 100644 --- a/infoport/static/js/project/resource.js +++ b/infoport/static/js/project/resource.js @@ -13,7 +13,11 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function treeselectSecond:[{ value:100, label:'全部' - }] + }], + useType:[{ + dictValue:'', + dictLabel:'全部' + }], }, }; var tools = new Tools(); @@ -37,7 +41,10 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function module.webDeptType = function (data) { if (data.code == 200) { var content = data.data; - module.data.useType = content; + content.map(res=>{ + module.data.useType.push(res) + }) + // module.data.useType = content; var useTypeData = template('useTypeData', module.data); $("#useTypeContent").html(useTypeData); } @@ -129,7 +136,14 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function selectChange = function(){ // tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.selectSecondChange , true); - module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; + if ($('#treeselectContent').val() == 100){ + module.data.treeselectSecond = [{ + value:100, + label:'全部' + }] + }else{ + module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children; + } var treeselectSecondData = template('treeselectSecondData', module.data); $("#treeselectSecondContent").html(treeselectSecondData);