蟑螂恶霸 2 years ago
parent
commit
064141f184
  1. 2
      src/views/enforce/earlyWarning.vue
  2. 100
      src/views/enforce/enforceNotice.vue
  3. 34
      src/views/enforceHome.vue

2
src/views/enforce/earlyWarning.vue

@ -189,7 +189,7 @@
const onClickButton = () => { const onClickButton = () => {
data.curPage = 1; data.curPage = 1;
data.dataList = []; data.dataList = [];
queryList(); onRefresh();
} }
const toComplaintView = (id, name) => { const toComplaintView = (id, name) => {

100
src/views/enforce/enforceNotice.vue

@ -1,4 +1,3 @@
<template> <template>
<div class="shop app_content"> <div class="shop app_content">
<!-- 导航栏 --> <!-- 导航栏 -->
@ -24,9 +23,9 @@
<!-- 中间 --> <!-- 中间 -->
<div class="shop-center"> <div class="shop-center">
<lodding-card :isLodding="isLodding">
<div class="noticebox"> <van-pull-refresh v-model="data.refreshing" @refresh="onRefresh">
<van-list v-model:loading="data.loading" :finished="data.finished" finished-text="没有更多了" @load="onLoad">
<div class="notice-item" v-for="(item, index) in data.dataList" :key="index"><i></i> <div class="notice-item" v-for="(item, index) in data.dataList" :key="index"><i></i>
<div class="item-cont"> <div class="item-cont">
<span class="item-title">{{ item.planName }}</span> <span class="item-title">{{ item.planName }}</span>
@ -37,22 +36,12 @@
<div>{{ item.createTime }}</div> <div>{{ item.createTime }}</div>
</div> </div>
</span> </span>
<div class="item-text" @click="toPdfView(null==item.fileObject?'':item.fileObject.fileUrl)"><a>{{ null==item.fileObject?'':item.fileObject.fileName }}</a></div> <div class="item-text" @click="toPdfView(null==item.fileObject?'':item.fileObject.fileUrl)">
</div> <a>{{ null==item.fileObject?'':item.fileObject.fileName }}</a></div>
</div>
<!-- <div class="notice-item"><i></i>
<div class="item-cont">
<span class="item-title">龙华区司法局</span>
<span class="item-time">2024-02-15</span>
<div class="item-text">2024年度龙华区民治街道年度行政执法检查计划</div>
</div> </div>
</div> -->
</div> </div>
</van-list>
</van-pull-refresh>
</lodding-card>
</div> </div>
<!-- 底部 --> <!-- 底部 -->
@ -64,6 +53,7 @@
<script setup name="enforcementInspectionProgram"> <script setup name="enforcementInspectionProgram">
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce"; import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const {useCommon} = $globalStore; const {useCommon} = $globalStore;
const router = useRouter(); const router = useRouter();
@ -71,6 +61,9 @@ let allchecked = ref(false); // 是否全选
let refreshLoad = ref(false); // 是否加载中 let refreshLoad = ref(false); // 是否加载中
let searchParam = reactive({ let searchParam = reactive({
// 分页
pageNum: 1,
pageSize: 6,
//搜索框 //搜索框
searchText: ref(''), searchText: ref(''),
//日期查询 //日期查询
@ -88,6 +81,11 @@ const data = reactive({
minDate: new Date(2020, 0, 1), minDate: new Date(2020, 0, 1),
maxDate: new Date(2125, 5, 1), maxDate: new Date(2125, 5, 1),
columnsType: ['year', 'month'], columnsType: ['year', 'month'],
loading: false,
finished: false,
refreshing: false,
curPage: 1,
total: 0,
}); });
// 设置初始值为当前时间 // 设置初始值为当前时间
@ -96,13 +94,21 @@ onMounted(() => {
// getCard(); // getCard();
searchParam.enterpriseNumber = useCommon.enterpriseNumber; searchParam.enterpriseNumber = useCommon.enterpriseNumber;
console.log(useCommon.enterpriseNumber) console.log(useCommon.enterpriseNumber)
queryList(); // queryList();
data.dateSearch = nowDate(new Date()); data.dateSearch = nowDate(new Date());
}); });
const queryList = () => { const queryList = () => {
searchParam.pageNum = (data.curPage-1)*searchParam.pageSize;
queryEnforcementInspectionProgramListNoPermission(searchParam, success => { queryEnforcementInspectionProgramListNoPermission(searchParam, success => {
console.log(success) data.curPage++;
data.dataList = success.data; data.loading = false; // 查4出结果停止加载
if (success.total <= data.dataList.length) {
// 查到最后没数据
data.finished = ref(true);
return;
}
// data.dataList = success.data;
data.dataList.push(...success.rows);
freshMap.refreshLoad = false; freshMap.refreshLoad = false;
freshMap.listLoading = false; freshMap.listLoading = false;
freshMap.listFinished = true; freshMap.listFinished = true;
@ -125,8 +131,9 @@ const onSearch = (val) => {
}) })
}; };
const onClickButton = () => { const onClickButton = () => {
console.log(searchParam.searchText) data.curPage = 1;
queryList(); data.dataList = [];
onRefresh();
} }
onActivated(() => { onActivated(() => {
}); });
@ -148,23 +155,28 @@ let freshMap = reactive({
listFinished: false, // 是否加载完成标识 listFinished: false, // 是否加载完成标识
}); });
//下拉刷新 //下拉刷新
const onRefresh = () => { const onRefresh = () => {
freshMap.listFinished = false; // 清空列表数据
freshMap.listLoading = true; data.dataList = [];
// getGoodslist(); data.finished = false;
queryList();
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
data.loading = true;
onLoad();
}; };
// 触底加载 // 触底加载
const onLoad = () => { const onLoad = () => {
freshMap.listFinished = true; setTimeout(() => {
freshMap.loading = false; if (data.refreshing) {
data.refreshing = false;
}
queryList();
}, 1000);
}; };
//获取分类下的商品列表 //获取分类下的商品列表
const getGoodslist = async (onLoad) => { const getGoodslist = async (onLoad) => {
// const res = await useClassify.classifyGoods(); // const res = await useClassify.classifyGoods();
@ -191,8 +203,7 @@ onMounted(async () => {
// } else { // } else {
// isLodding.value = false; // isLodding.value = false;
// } // }
queryList(); // queryList();
isLodding.value = false;
}); });
const selectDate = () => { const selectDate = () => {
@ -208,7 +219,10 @@ const onDateConfirm = (value)=> {
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1] data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1]
data.showDatePicker = false; data.showDatePicker = false;
searchParam.dateSearch = value.selectedValues[0] + "-" + value.selectedValues[1]; searchParam.dateSearch = value.selectedValues[0] + "-" + value.selectedValues[1];
queryList();
data.curPage = 1;
data.dataList = [];
onRefresh();
} }
const nowDate = (time) => { const nowDate = (time) => {
var year = time.getFullYear(); // 年 var year = time.getFullYear(); // 年
@ -226,12 +240,18 @@ const nowDate = (time) => {
const searchDateType = (val) => { const searchDateType = (val) => {
searchParam.dateType = val; searchParam.dateType = val;
searchParam.isComplaint = null; searchParam.isComplaint = null;
queryList();
data.curPage = 1;
data.dataList = [];
onRefresh();
} }
const searchComplaint = (val) => { const searchComplaint = (val) => {
searchParam.isComplaint = val; searchParam.isComplaint = val;
searchParam.dateType = null; searchParam.dateType = null;
queryList();
data.curPage = 1;
data.dataList = [];
onRefresh();
} }
const toPdfView = (url) => { const toPdfView = (url) => {
@ -281,11 +301,13 @@ const toPdfView = (url) =>{
width: 100%; width: 100%;
padding: 0.27rem 0; padding: 0.27rem 0;
flex-direction: column; flex-direction: column;
.card_body { .card_body {
background-color: #fff; background-color: #fff;
border-radius: 0.27rem; border-radius: 0.27rem;
flex: 1; flex: 1;
} }
.card_box_span { .card_box_span {
display: flex; display: flex;
align-items: center; align-items: center;
@ -298,6 +320,7 @@ const toPdfView = (url) =>{
margin: 0; margin: 0;
} }
} }
.card_box_action { .card_box_action {
position: absolute; position: absolute;
right: 4%; right: 4%;
@ -309,6 +332,7 @@ const toPdfView = (url) =>{
.shop_footer_body { .shop_footer_body {
//height: 101px; //height: 101px;
position: relative; position: relative;
.footer-one-btn { .footer-one-btn {
height: 1.33rem; height: 1.33rem;
bottom: 1.34rem; bottom: 1.34rem;
@ -323,6 +347,7 @@ const toPdfView = (url) =>{
padding-left: 0.27rem; padding-left: 0.27rem;
margin-top: 0.27rem; margin-top: 0.27rem;
align-items: end; align-items: end;
.search-button { .search-button {
width: 15%; width: 15%;
height: 100%; height: 100%;
@ -332,6 +357,7 @@ const toPdfView = (url) =>{
font-size: 0.3rem; font-size: 0.3rem;
} }
} }
.search-button-date { .search-button-date {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -341,11 +367,13 @@ const toPdfView = (url) =>{
.date-select { .date-select {
font-size: 0.52rem; font-size: 0.52rem;
margin: 3% 0 0 4%; margin: 3% 0 0 4%;
i { i {
transform: rotate(90deg); transform: rotate(90deg);
font-size: 0.4rem; font-size: 0.4rem;
} }
} }
.search-button { .search-button {
width: 15%; width: 15%;
height: 80%; height: 80%;

34
src/views/enforceHome.vue

@ -84,6 +84,7 @@
import {Loading} from 'vant'; import {Loading} from 'vant';
import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home'; import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home';
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce"; import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const isLoading = ref(true); const isLoading = ref(true);
const {useCommon} = $globalStore; const {useCommon} = $globalStore;
const router = useRouter(); const router = useRouter();
@ -177,32 +178,31 @@
} }
const queryList = () => { const queryList = () => {
queryEnforcementInspectionProgramListNoPermission({}, success => { queryEnforcementInspectionProgramListNoPermission({}, success => {
console.log(success) if (success.rows.length > 4) {
if(success.data.length > 4 ){
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
carouselList.push(success.data[i]); carouselList.push(success.rows[i]);
noticeObj.noticeList.push(success.data[i].planName) noticeObj.noticeList.push(success.rows[i].planName)
var obj = { var obj = {
content: success.data[i].planName content: success.rows[i].planName
} }
data.noticeList.push(obj) data.noticeList.push(obj)
// noticeStr += success.data[i].planName + " "; // noticeStr += success.data[i].planName + " ";
// noticeStr += success.data[i].planName != null ?success.data[i].planName + "":""; // noticeStr += success.data[i].planName != null ?success.data[i].planName + "":"";
} }
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":""; noticeStr += success.rows[0].planName != null ? success.rows[0].planName + "" : "";
} else { } else {
carouselList = success.data; carouselList = success.rows;
for (let i = 0; i <= success.data.length; i++) { for (let i = 0; i < success.rows.length; i++) {
// carouselList.push(success.data[i]); // carouselList.push(success.data[i]);
noticeObj.noticeList.push(success.data[i].planName); noticeObj.noticeList.push(success.rows[i].planName);
}
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":"";
var obj = { var obj = {
content: success.data[i].planName content: success.rows[i].planName
} }
data.noticeList.push(obj) data.noticeList.push(obj)
} }
// noticeStr += success.rows[0].planName != null ? success.rows[0].planName + "" : "";
}
freshMap.key = 1 freshMap.key = 1
console.log(carouselList); console.log(carouselList);
console.log(data.noticeList); console.log(data.noticeList);
@ -386,6 +386,7 @@
font-size: 0.5rem; font-size: 0.5rem;
} }
} }
.box-qr-code::before { .box-qr-code::before {
content: ""; content: "";
position: absolute; position: absolute;
@ -430,6 +431,7 @@
font-size: 0.5rem; font-size: 0.5rem;
} }
} }
.box-info::before { .box-info::before {
content: ""; content: "";
position: absolute; position: absolute;
@ -475,6 +477,7 @@
} }
} }
} }
.box-complaint::before { .box-complaint::before {
content: ""; content: "";
position: absolute; position: absolute;
@ -622,14 +625,17 @@
background: url("../assets/images/logo.png") no-repeat; background: url("../assets/images/logo.png") no-repeat;
background-size: 100% auto; background-size: 100% auto;
} }
.loading-div { .loading-div {
position: absolute; position: absolute;
top: 45%; top: 45%;
left: 48%; left: 48%;
} }
.notice-bar-container { .notice-bar-container {
margin-bottom: 0.27rem; margin-bottom: 0.27rem;
} }
.notice-bar-container:last-child { .notice-bar-container:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
@ -666,6 +672,7 @@
.noticeContent ul { .noticeContent ul {
width: 100%; width: 100%;
} }
.noticeContent li { .noticeContent li {
position: relative; position: relative;
margin: 0.27rem 0 0 0; margin: 0.27rem 0 0 0;
@ -680,6 +687,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
box-sizing: border-box; box-sizing: border-box;
} }
.noticeContent li::before { .noticeContent li::before {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
@ -691,12 +699,14 @@
background: url("../assets/images/icon_notice.png") no-repeat; background: url("../assets/images/icon_notice.png") no-repeat;
background-size: auto 85%; background-size: auto 85%;
} }
.notice_list { .notice_list {
display: block; display: block;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
.notice_top { .notice_top {
transition: all 0.5s; transition: all 0.5s;
margin-top: -30px; margin-top: -30px;

Loading…
Cancel
Save