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

2
src/views/enforce/earlyWarning.vue

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

276
src/views/enforce/enforceNotice.vue

@ -1,4 +1,3 @@
<template>
<div class="shop app_content">
<!-- 导航栏 -->
@ -24,35 +23,25 @@
<!-- 中间 -->
<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="item-cont">
<span class="item-title">{{ item.planName }}</span>
<!-- <span class="item-time"> {{ item.enforcementDepartment }} - {{ item.createTime }}</span>-->
<!-- <span class="item-time"> {{ item.enforcementDepartment }} - {{ item.createTime }}</span>-->
<span class="item-time">
<div style="display: flex; justify-content: space-between;">
<div>{{ item.enforcementDepartment }}</div>
<div>{{ item.createTime }}</div>
</div>
</span>
<div class="item-text" @click="toPdfView(null==item.fileObject?'':item.fileObject.fileUrl)"><a>{{ null==item.fileObject?'':item.fileObject.fileName }}</a></div>
</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 class="item-text" @click="toPdfView(null==item.fileObject?'':item.fileObject.fileUrl)">
<a>{{ null==item.fileObject?'':item.fileObject.fileName }}</a></div>
</div>
</div> -->
</div>
</lodding-card>
</van-list>
</van-pull-refresh>
</div>
<!-- 底部 -->
@ -63,110 +52,133 @@
</template>
<script setup name="enforcementInspectionProgram">
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const { useCommon} = $globalStore;
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const {useCommon} = $globalStore;
const router = useRouter();
let allchecked = ref(false); // 是否全选
let refreshLoad = ref(false); // 是否加载中
const router = useRouter();
let allchecked = ref(false); // 是否全选
let refreshLoad = ref(false); // 是否加载中
let searchParam = reactive({
let searchParam = reactive({
// 分页
pageNum: 1,
pageSize: 6,
//搜索框
searchText: ref(''),
//日期查询
searchDate: ref(''),
//是否发布 1 是
isPublish: 1
});
});
const data = reactive({
const data = reactive({
cartList: [],
dataList: [],
dateSearch: ref(),
showDatePicker:false,
currentDate:ref(['2024', '01']),
showDatePicker: false,
currentDate: ref(['2024', '01']),
minDate: new Date(2020, 0, 1),
maxDate: new Date(2125, 5, 1),
columnsType :['year', 'month'],
});
columnsType: ['year', 'month'],
loading: false,
finished: false,
refreshing: false,
curPage: 1,
total: 0,
});
// 设置初始值为当前时间
onMounted(() => {
onMounted(() => {
console.log(useCommon.enterpriseNumber);
// getCard();
searchParam.enterpriseNumber = useCommon.enterpriseNumber;
console.log(useCommon.enterpriseNumber)
queryList();
// queryList();
data.dateSearch = nowDate(new Date());
});
const queryList = () =>{
queryEnforcementInspectionProgramListNoPermission(searchParam,success =>{
console.log(success)
data.dataList = success.data;
});
const queryList = () => {
searchParam.pageNum = (data.curPage-1)*searchParam.pageSize;
queryEnforcementInspectionProgramListNoPermission(searchParam, success => {
data.curPage++;
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.listLoading = false;
freshMap.listFinished = true;
isLodding.value = false;
},error =>{
}, error => {
})
}
}
const onSearch = (val) => {
const onSearch = (val) => {
queryEnforcementInspectionProgramListNoPermission(
{
"searchText": searchParam.searchText
}
,success =>{
, success => {
console.log(success)
data.dataList = success.data;
},error =>{
}, error => {
})
};
const onClickButton = () =>{
console.log(searchParam.searchText)
queryList();
}
onActivated(() => {
});
};
const onClickButton = () => {
data.curPage = 1;
data.dataList = [];
onRefresh();
}
onActivated(() => {
});
onDeactivated(() => {
onDeactivated(() => {
});
});
// 返回
const goBack = () => {
// 返回
const goBack = () => {
router.go(-1);
};
};
let resetScroll = ref(0); // 滚动记录
let isLodding = ref(true); // 是否加载中
let freshMap = reactive({
let resetScroll = ref(0); // 滚动记录
let isLodding = ref(true); // 是否加载中
let freshMap = reactive({
refreshLoad: false, // 是否刷新
listLoading: false, // 是否加载中
listFinished: false, // 是否加载完成标识
});
});
//下拉刷新
const onRefresh = () => {
freshMap.listFinished = false;
freshMap.listLoading = true;
// getGoodslist();
//下拉刷新
const onRefresh = () => {
// 清空列表数据
data.dataList = [];
data.finished = false;
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
data.loading = true;
onLoad();
};
// 触底加载
const onLoad = () => {
setTimeout(() => {
if (data.refreshing) {
data.refreshing = false;
}
queryList();
};
// 触底加载
const onLoad = () => {
freshMap.listFinished = true;
freshMap.loading = false;
};
}, 1000);
};
//获取分类下的商品列表
const getGoodslist = async (onLoad) => {
//获取分类下的商品列表
const getGoodslist = async (onLoad) => {
// const res = await useClassify.classifyGoods();
// if (res?.code === 20000) {
// goodsList = onLoad ? goodsList.concat(res?.data) : res?.data;
@ -181,9 +193,9 @@ const getGoodslist = async (onLoad) => {
freshMap.listLoading = false;
freshMap.listFinished = true;
isLodding.value = false;
};
};
onMounted(async () => {
onMounted(async () => {
// let res = await getClassify();
// if (res && res?.length) {
// classifyId = res?.[0]?.id;
@ -191,26 +203,28 @@ onMounted(async () => {
// } else {
// isLodding.value = false;
// }
queryList();
isLodding.value = false;
});
// queryList();
});
const selectDate = () =>{
const selectDate = () => {
data.showDatePicker = true;
console.log(data.showDatePicker)
}
}
const onDateConfirm = (value)=> {
const onDateConfirm = (value) => {
console.log(value);
value.selectedValues.forEach((item,index) => {
value.selectedValues.forEach((item, index) => {
console.log(item);
});
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1]
data.showDatePicker = false;
searchParam.dateSearch = value.selectedValues[0] + "-" + value.selectedValues[1];
queryList();
}
const nowDate = (time) => {
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const nowDate = (time) => {
var year = time.getFullYear(); // 年
var month = (time.getMonth() + 1).toString().padStart(2, '0'); // 月
var date = time.getDate().toString().padStart(2, '0'); // 日
@ -220,21 +234,27 @@ const nowDate = (time) => {
return (
year + "/" + month
)
}
}
const searchDateType = (val) =>{
const searchDateType = (val) => {
searchParam.dateType = val;
searchParam.isComplaint = null;
queryList();
}
const searchComplaint = (val) =>{
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const searchComplaint = (val) => {
searchParam.isComplaint = val;
searchParam.dateType = null;
queryList();
}
const toPdfView = (url) =>{
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const toPdfView = (url) => {
console.log(url)
router.push(
{
@ -243,11 +263,11 @@ const toPdfView = (url) =>{
url: url
}
});
}
}
</script>
<style lang="less" scoped>
.shop {
.shop {
height: 100%;
display: flex;
flex-direction: column;
@ -281,11 +301,13 @@ const toPdfView = (url) =>{
width: 100%;
padding: 0.27rem 0;
flex-direction: column;
.card_body {
background-color: #fff;
border-radius: 0.27rem;
flex: 1;
}
.card_box_span {
display: flex;
align-items: center;
@ -298,7 +320,8 @@ const toPdfView = (url) =>{
margin: 0;
}
}
.card_box_action{
.card_box_action {
position: absolute;
right: 4%;
}
@ -309,21 +332,23 @@ const toPdfView = (url) =>{
.shop_footer_body {
//height: 101px;
position: relative;
.footer-one-btn {
height: 1.33rem;
bottom: 1.34rem;
}
}
}
}
.search-button-list{
.search-button-list {
height: 0.7rem;
display: flex;
flex-direction: row;
padding-left: 0.27rem;
margin-top: 0.27rem;
align-items: end;
.search-button{
.search-button {
width: 15%;
height: 100%;
background: #e3e0e0;
@ -331,8 +356,9 @@ const toPdfView = (url) =>{
color: #4c4c4c;
font-size: 0.3rem;
}
}
.search-button-date {
}
.search-button-date {
display: flex;
flex-direction: row;
align-items: end;
@ -341,53 +367,55 @@ const toPdfView = (url) =>{
.date-select {
font-size: 0.52rem;
margin: 3% 0 0 4%;
i {
transform: rotate(90deg);
font-size: 0.4rem;
}
}
.search-button{
.search-button {
width: 15%;
height: 80%;
position: absolute;
top: 1%;
right: 1%;
}
}
}
.noticebox {
.noticebox {
position: absolute;
top: 0;
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 0.2rem;
}
}
.notice-item {
.notice-item {
display: flex;
position: relative;
margin: 3% 0.26rem;
height: 10vh;
align-items: center;
border-bottom: 1px solid #f3f4f5;
}
}
.notice-item > i {
.notice-item > i {
display: inline-block;
margin: 5% 0.25rem;
height: 80%;
width: 1.5rem;
background: url("../../assets/images/icon_notice2.png") no-repeat left top 50%;
background-size: auto 80%;
}
}
.item-cont {
.item-cont {
display: inline-block;
width: calc(100% - 2.0rem);
}
}
.item-time {
.item-time {
float: left;
margin: 2% 0;
width: 100%;
@ -395,9 +423,9 @@ const toPdfView = (url) =>{
font-size: 0.3rem;
//height: 0.75rem;
//line-height: 1rem;
}
}
.item-title, .item-text {
.item-title, .item-text {
float: left;
margin: 0;
width: 100%;
@ -407,26 +435,26 @@ const toPdfView = (url) =>{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.item-text {
.item-text {
width: 100%;
color: #999;
font-size: 0.35rem;
font-weight: normal;
}
}
.item-text a {
.item-text a {
color: #2b75fd;
}
}
/deep/ .van-search__content {
/deep/ .van-search__content {
height: 0.9rem;
border: 1px solid #ececec;
border-radius: 0.15rem 0 0 0.15rem;
}
}
/deep/ .van-search__action {
/deep/ .van-search__action {
margin: 0 3% 0 0;
width: 10%;
height: 0.9rem;
@ -436,6 +464,6 @@ const toPdfView = (url) =>{
color: #fff;
text-align: center;
line-height: 0.9rem;
}
}
</style>

70
src/views/enforceHome.vue

@ -1,6 +1,6 @@
<template>
<!-- <Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa" />-->
<!-- <div class="home app_content" v-if="!isLoading">-->
<!-- <Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa" />-->
<!-- <div class="home app_content" v-if="!isLoading">-->
<div class="home app_content">
<!-- 导航栏 -->
<!-- <div class="header_body">
@ -9,7 +9,7 @@
<!-- 中间 -->
<div class="warp_body" >
<div class="warp_body">
<div class="logobox"></div>
<!-- <div class="streamer" @click="">
<i></i>
@ -81,9 +81,10 @@
<script setup name="Home">
import Vconsolefrom from 'vconsole';
import { Loading } from 'vant';
import {Loading} from 'vant';
import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home';
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const isLoading = ref(true);
const {useCommon} = $globalStore;
const router = useRouter();
@ -175,47 +176,46 @@
path: "/enforce/enforceNotice",
});
}
const queryList = () =>{
queryEnforcementInspectionProgramListNoPermission({},success =>{
console.log(success)
if(success.data.length > 4 ){
const queryList = () => {
queryEnforcementInspectionProgramListNoPermission({}, success => {
if (success.rows.length > 4) {
for (let i = 0; i < 5; i++) {
carouselList.push(success.data[i]);
noticeObj.noticeList.push(success.data[i].planName)
carouselList.push(success.rows[i]);
noticeObj.noticeList.push(success.rows[i].planName)
var obj = {
content: success.data[i].planName
content: success.rows[i].planName
}
data.noticeList.push(obj)
// noticeStr += success.data[i].planName + " ";
// noticeStr += success.data[i].planName != null ?success.data[i].planName + "":"";
}
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":"";
}else{
carouselList = success.data;
noticeStr += success.rows[0].planName != null ? success.rows[0].planName + "" : "";
} else {
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]);
noticeObj.noticeList.push(success.data[i].planName);
}
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":"";
noticeObj.noticeList.push(success.rows[i].planName);
var obj = {
content: success.data[i].planName
content: success.rows[i].planName
}
data.noticeList.push(obj)
}
// noticeStr += success.rows[0].planName != null ? success.rows[0].planName + "" : "";
}
freshMap.key = 1
console.log(carouselList);
console.log(data.noticeList);
// timerObj.timer = setInterval(flushMessage, 4000);
setNotificationMove();
},error =>{
}, error => {
})
}
const flushMessage =() =>{
const flushMessage = () => {
timerObj.value++;
freshMap.key = timerObj.value;
if(carouselList.length == timerObj.value){
if (carouselList.length == timerObj.value) {
timerObj.value = 0;
}
freshMap.key = timerObj.value;
@ -248,7 +248,7 @@
console.log(success.data)
useCommon.SET_USER_ID(success.data.userId);
useCommon.SET_TOKEN(success.data.token);
if(useCommon.firstLoad){
if (useCommon.firstLoad) {
isLoading.value = false;
}
//设置已经初始化
@ -274,7 +274,7 @@
// queryList();
setInterval(showNotice, 3000)
});
const setNotificationMove =()=>{
const setNotificationMove = () => {
// 清除定时器
clearInterval(noticeObj.noticeTimer);
const notificationContainer = document.getElementById(
@ -305,7 +305,7 @@
notification.style.transform = `translateX(${noticeObj.offset}px)`;
}, noticeObj.speed);
}
const delayNoticeMove = () =>{
const delayNoticeMove = () => {
const notification = document.getElementById("notification");
let currentOffset = notification.style.transform;
if (currentOffset) {
@ -327,7 +327,7 @@
data.noticeList.shift()
freshMap.animate = false
}, 500)
}
}
</script>
@ -386,6 +386,7 @@
font-size: 0.5rem;
}
}
.box-qr-code::before {
content: "";
position: absolute;
@ -395,7 +396,7 @@
width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem);
background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5);
border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem;
}
@ -430,6 +431,7 @@
font-size: 0.5rem;
}
}
.box-info::before {
content: "";
position: absolute;
@ -439,7 +441,7 @@
width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem);
background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5);
border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem;
}
@ -475,6 +477,7 @@
}
}
}
.box-complaint::before {
content: "";
position: absolute;
@ -484,7 +487,7 @@
width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem);
background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5);
border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem;
}
@ -622,14 +625,17 @@
background: url("../assets/images/logo.png") no-repeat;
background-size: 100% auto;
}
.loading-div{
.loading-div {
position: absolute;
top: 45%;
left: 48%;
}
.notice-bar-container {
margin-bottom: 0.27rem;
}
.notice-bar-container:last-child {
margin-bottom: 0;
}
@ -666,6 +672,7 @@
.noticeContent ul {
width: 100%;
}
.noticeContent li {
position: relative;
margin: 0.27rem 0 0 0;
@ -680,6 +687,7 @@
text-overflow: ellipsis;
box-sizing: border-box;
}
.noticeContent li::before {
display: inline-block;
position: absolute;
@ -691,12 +699,14 @@
background: url("../assets/images/icon_notice.png") no-repeat;
background-size: auto 85%;
}
.notice_list {
display: block;
position: absolute;
top: 0;
left: 0;
}
.notice_top {
transition: all 0.5s;
margin-top: -30px;

Loading…
Cancel
Save