Commit 94620bc0 authored by xinzhedeai's avatar xinzhedeai

法律法规、通知公告 分页问题处理

parent 2341938a
[v-cloak] { [v-cloak] {
display: none; display: none;
} }
/* 基础工具样式类 */ /* 基础工具样式类 */
.pd-01rem { .pd-01rem {
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
......
...@@ -34,22 +34,12 @@ ...@@ -34,22 +34,12 @@
font-weight: bold; font-weight: bold;
} }
.wrapper .item .bgImg1:first-child { .wrapper .item .bgImg:first-child {
background-image: url('./image/yh-list.png'); background-image: url('./image/yellow.png');
} }
/* .wrapper .item .bgImg1:last-child { .wrapper .item .bgImg:last-child {
background-image: url('./image/dw-list.png'); background-image: url('./image/blue.png');
} */
.wrapper .item .bgImg2:first-child {
background-image: url('./image/notice-list.png');
}
.wrapper .item .bgImg2:last-child {
background-image: url('./image/law-list.png');
}
.wrapper .item .bgImg3:first-child {
background-image: url('./image/emergency.png');
} }
.wrapper .item .bgImg span { .wrapper .item .bgImg span {
...@@ -62,31 +52,33 @@ ...@@ -62,31 +52,33 @@
<!-- 获取授权用户信息 本地token等操作 --> <!-- 获取授权用户信息 本地token等操作 -->
<script type="text/javascript" src="sdk/jssdk2/index.js"></script> <script type="text/javascript" src="sdk/jssdk2/index.js"></script>
<div id="app"> <div id="app">
<div class="wrapper"> <div class="wrapper">
<div class="item"> <div class="item">
<p class="bgImg bgImg1" @click="nav('yh-list')"> <p class="bgImg" @click="nav('yh-list')">
<span>隐患管理</span>
</p> </p>
<!-- <p class="bgImg bgImg1" @click="nav('dw-list')"> <!-- <button @click="link()">打开图片</button>
<button @click="link('pdf')">打开pdf</button> -->
<!-- <p class="bgImg" @click="nav('dw-list')">
<span>危险作业备案</span>
</p> --> </p> -->
</div> </div>
<!-- <div class="item"> <div class="item">
<p class="bgImg bgImg2" @click="nav('notice-list')"> <p class="bgImg" @click="nav('notice-list')">
<span>通知公告</span>
</p> </p>
<p class="bgImg bgImg2" @click="nav('law-lv1')"> <p class="bgImg" @click="nav('law-lv1')">
<span>法律法规</span>
</p> </p>
</div> </div>
<div class="item"> <!-- <div class="item">
<p class="bgImg bgImg3" @click="nav('emergency')"> <p class="bgImg" @click="nav('emergency')">
<span>应急演练</span>
</p> </p>
</div> --> </div> -->
</div> </div>
</div> </div>
</body> </body>
<!-- <span>通知公告</span> -->
<!-- <span>应急演练</span> -->
<!-- <span>法律法规</span> -->
<!-- <span>危险作业备案</span> -->
<!-- <span>隐患管理</span> -->
</html> </html>
\ No newline at end of file
...@@ -16,7 +16,7 @@ var http2 = { ...@@ -16,7 +16,7 @@ var http2 = {
*/ */
const data = SM.encrypt(JSON.stringify(params.reqParams), params.interfacePublicKey) const data = SM.encrypt(JSON.stringify(params.reqParams), params.interfacePublicKey)
// console.log('http2方法进来了~普通请求参数', JSON.stringify(params.reqParams)) console.log('http2方法进来了~普通请求参数', JSON.stringify(params.reqParams))
const extraData = { // 公共请求头设置 const extraData = { // 公共请求头设置
// header: { // header: {
......
...@@ -20,8 +20,8 @@ document.write('<script type="text/javascript" src="https://isdapp.shandong.gov. ...@@ -20,8 +20,8 @@ document.write('<script type="text/javascript" src="https://isdapp.shandong.gov.
<script type="text/javascript" src="' + contextPath + '/sdk/jssdk2/sm2/build/SM.js"></script>'); <script type="text/javascript" src="' + contextPath + '/sdk/jssdk2/sm2/build/SM.js"></script>');
// 移动端 debugger 调试 // 移动端 debugger 调试
// document.write('<script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/eruda/2.4.1/eruda.js"></script>\ document.write('<script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/eruda/2.4.1/eruda.js"></script>\
// <script>eruda.init();</script>'); <script>eruda.init();</script>');
/** /**
* 项目业务相关 js * 项目业务相关 js
......
...@@ -7,7 +7,7 @@ window.addEventListener("load", function() { ...@@ -7,7 +7,7 @@ window.addEventListener("load", function() {
el: '#app', el: '#app',
data() { data() {
return { return {
previewUrl: axios.defaults.baseURL, previewUrl: BASE_URL,
form: { form: {
id: '', id: '',
companyId: '', companyId: '',
......
...@@ -39,23 +39,6 @@ window.addEventListener("load", function() { ...@@ -39,23 +39,6 @@ window.addEventListener("load", function() {
console.log('search', val) console.log('search', val)
this.getList() this.getList()
}, },
exportFile(item){
http.downloadFile('/api/dangerJobReport/export',{
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
fileName: 'DW-'+ gemhoUtil.getTargetDateYMD().replaceAll('-', '') +'.xlsx'
}).then((res)=>{
vant.Toast({
message: '操作成功',
})
this.loading = false; // 加载状态结束
})
},
add(){
gemhoUtil.navigatePage('./dw-list-detail.html?type=add')
},
edit(item){
gemhoUtil.navigatePage('./dw-list-detail.html?planId='+item.id+'&type=edit')
},
getList(){ getList(){
if(this.loading){ if(this.loading){
return return
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak> <div class="content" v-cloak>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList"> <van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList" :immediate-check="false">
<van-cell v-for="(item, index) in list" :key="item"> <van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click="detail(index)"> <div class="list-item-wrapper" @click="detail(index)">
<p class=""> <p class="">
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<p class=""> <p class="">
{{item.lawTitle}} {{item.lawTitle}}
</p> </p>
<div class="list-function-btn-wrapper pd-01rem" style="justify-content: space-between;"> <div class="list-function-btn-wrapper pd-01rem" style="justify-content: space-between; color: gray;">
<span>{{item.lawPublisher}}</span> <span>{{item.lawPublisher}}</span>
<span>{{item.lawDate}}</span> <span>{{item.lawDate}}</span>
</div> </div>
......
...@@ -13,7 +13,7 @@ window.addEventListener("load", function() { ...@@ -13,7 +13,7 @@ window.addEventListener("load", function() {
loading: false, loading: false,
finished: false, finished: false,
page: 0, page: 0,
size: 999, size: 10,
total: 0 total: 0
} }
}, },
...@@ -21,41 +21,45 @@ window.addEventListener("load", function() { ...@@ -21,41 +21,45 @@ window.addEventListener("load", function() {
this.getList() this.getList()
}, },
methods: { methods: {
detail(index){ detail(index) {
this.list[index].currentUserRead = true this.list[index].currentUserRead = true
// location.href = './law-list-detail.html?law_id='+this.list[index].lawId // location.href = './law-list-detail.html?law_id='+this.list[index].lawId
gemhoUtil.navigatePage('./law-list-detail.html?law_id='+this.list[index].lawId) gemhoUtil.navigatePage('./law-list-detail.html?law_id=' + this.list[index].lawId)
}, },
getList(){ getList() {
if(this.loading){ // if(this.loading){
return // return
} // }
this.loading = true // this.loading = true
setTimeout(() => {
http2.post({ http2.post({
serviceId: API_KEY_MAP["law-list"]['id'], serviceId: API_KEY_MAP["law-list"]['id'],
interfacePublicKey: API_KEY_MAP["law-list"]["publicKey"], interfacePublicKey: API_KEY_MAP["law-list"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["law-list"]["privateKey"], interfacePrivateKey: API_KEY_MAP["law-list"]["privateKey"],
reqParams: { reqParams: {
page: this.page++,// 每次请求增加下一页 page: this.page++, // 每次请求增加下一页
size: this.size, size: this.size,
category_id: gemhoUtil.getParameter('category_id'), category_id: gemhoUtil.getParameter('category_id'),
sort: 'lawId,desc', sort: 'lawId,desc',
} }
}, (res) => { }, (res) => {
if(res){ if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
this.list.push(...result.content); this.list.push(...result.content);
this.total = result.totalElements this.total = result.totalElements
if(this.page*this.size >= this.total){ if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
}, 0)
} }
}, },
}); });
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak> <div class="content" v-cloak>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList"> <van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList" :immediate-check="false">
<van-cell v-for="(item, index) in list" :key="item"> <van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click="nav(item)" > <div class="list-item-wrapper" @click="nav(item)" >
<p class=""> <p class="">
......
...@@ -13,7 +13,7 @@ window.addEventListener("load", function() { ...@@ -13,7 +13,7 @@ window.addEventListener("load", function() {
loading: false, loading: false,
finished: false, finished: false,
page: 0, page: 0,
size: 999, size: 20,
total: 0 total: 0
} }
}, },
...@@ -21,27 +21,30 @@ window.addEventListener("load", function() { ...@@ -21,27 +21,30 @@ window.addEventListener("load", function() {
this.getList() this.getList()
}, },
methods: { methods: {
nav(item){ nav(item) {
// location.href='./law-lv2.html?pid=' + item.id // location.href='./law-lv2.html?pid=' + item.id
gemhoUtil.navigatePage('./law-lv2.html?pid=' + item.id) gemhoUtil.navigatePage('./law-lv2.html?pid=' + item.id)
}, },
getList(){ getList() {
if(this.loading){ // if(this.loading){
return // return
} // }
this.loading = true // this.loading = true
setTimeout(() => {
http2.post({ http2.post({
serviceId: API_KEY_MAP["law-lv"]['id'], serviceId: API_KEY_MAP["law-lv"]['id'],
interfacePublicKey: API_KEY_MAP["law-lv"]["publicKey"], interfacePublicKey: API_KEY_MAP["law-lv"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["law-lv"]["privateKey"], interfacePrivateKey: API_KEY_MAP["law-lv"]["privateKey"],
reqParams: { reqParams: {
page: this.page++,// 每次请求增加下一页 page: this.page++, // 每次请求增加下一页
size: this.size, size: this.size,
// sort: 'createTime,desc', // sort: 'createTime,desc',
} }
}, (res) => { }, (res) => {
if(res){ if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
...@@ -49,12 +52,13 @@ window.addEventListener("load", function() { ...@@ -49,12 +52,13 @@ window.addEventListener("load", function() {
this.list.push(...result.content); this.list.push(...result.content);
this.total = result.totalElements this.total = result.totalElements
if(this.page*this.size >= this.total){ if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
}, 0)
} }
}, },
}); });
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak> <div class="content" v-cloak>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList"> <van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList" :immediate-check="false">
<van-cell v-for="(item, index) in list" :key="item"> <van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click=nav(item.id)> <div class="list-item-wrapper" @click=nav(item.id)>
<p class=""> <p class="">
......
...@@ -11,7 +11,7 @@ window.addEventListener("load", function() { ...@@ -11,7 +11,7 @@ window.addEventListener("load", function() {
loading: false, loading: false,
finished: false, finished: false,
page: 0, page: 0,
size: 999, size: 20,
total: 0 total: 0
} }
}, },
...@@ -20,28 +20,31 @@ window.addEventListener("load", function() { ...@@ -20,28 +20,31 @@ window.addEventListener("load", function() {
this.getList() this.getList()
}, },
methods: { methods: {
nav(category_id){ nav(category_id) {
// location.href = './law-list.html?category_id=' + category_id // location.href = './law-list.html?category_id=' + category_id
gemhoUtil.navigatePage('./law-list.html?category_id=' + category_id) gemhoUtil.navigatePage('./law-list.html?category_id=' + category_id)
}, },
getList(){ getList() {
if(this.loading){ // if(this.loading){
return // return
} // }
this.loading = true // this.loading = true
setTimeout(() => {
http2.post({ http2.post({
serviceId: API_KEY_MAP["law-lv"]['id'], serviceId: API_KEY_MAP["law-lv"]['id'],
interfacePublicKey: API_KEY_MAP["law-lv"]["publicKey"], interfacePublicKey: API_KEY_MAP["law-lv"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["law-lv"]["privateKey"], interfacePrivateKey: API_KEY_MAP["law-lv"]["privateKey"],
reqParams: { reqParams: {
page: this.page++,// 每次请求增加下一页 page: this.page++, // 每次请求增加下一页
size: this.size, size: this.size,
pid: gemhoUtil.getParameter('pid'), pid: gemhoUtil.getParameter('pid'),
// sort: 'createTime,desc', // sort: 'createTime,desc',
} }
}, (res) => { }, (res) => {
if(res){ if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
...@@ -49,15 +52,16 @@ window.addEventListener("load", function() { ...@@ -49,15 +52,16 @@ window.addEventListener("load", function() {
this.list.push(...result.content); this.list.push(...result.content);
this.total = result.totalElements this.total = result.totalElements
if(!this.list.length){ if (!this.list.length) {
this.nav(gemhoUtil.getParameter('pid')) this.nav(gemhoUtil.getParameter('pid'))
} }
if(this.page*this.size >= this.total){ if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
}, 0)
} }
}, },
}); });
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
.van-cell__value{overflow: unset; } .van-cell__value{overflow: unset; }
.van-cell:after{border-bottom:none;} .van-cell:after{border-bottom:none;}
.van-radio-group--horizontal{float: right;} .van-radio-group--horizontal{float: right;}
/* font-size: 0.48rem; */
</style> </style>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak style="font-size: 0.48rem; padding:0.15rem" v-html="noticeContent"></div> <div class="content" v-cloak style="padding:0.15rem" v-html="noticeContent"></div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment