数据处理

This commit is contained in:
xuli3099
2025-08-13 09:22:58 +08:00
parent 107cc64a81
commit 0728d92094
7 changed files with 92 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
#调用后台地址
VITE_APP_BASE_URL = "http://192.168.236.71:31302"
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"

View File

@@ -1,4 +1,5 @@
#调用后台地址
VITE_APP_BASE_URL = "http://192.168.236.71:31302"
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"

View File

@@ -151,11 +151,21 @@ import { backBlogCount,swiperList,stepData,salesTask,commonServices,newsQueryLis
import { getWeekStr,formatTimestamp } from '@/utils/datetime.js'
import { formatMoney } from '@/utils/formatter.js'
onLoad(async(opt) => {
uni.setStorageSync('page_cache',true);
initLoad();
})
// 初始化调用方法
const initLoad =()=>{
getBackBlogCount();
getSwiperList();
getStepData();
getSalesTask();
getCommonServices();
getNewsList();
}
// 下拉刷新
const mescrollRef = ref(null);
const mescrollInit = (mescroll) => {
@@ -171,9 +181,10 @@ const downOption = ref({
// 下拉刷新
const downCallback = async (mescroll) => {
try {
setTimeout(async ()=>{
// mescroll.resetUpScroll();
},500);
// setTimeout(async ()=>{
// // mescroll.resetUpScroll();
// },500);
initLoad();
} catch (error) {
mescroll.endErr();
} finally {
@@ -213,24 +224,32 @@ let backBlogObj = ref({})
let getBackBlogCount = async () =>{
backBlogObj.value = await backBlogCount();
}
getBackBlogCount();
// 跑马灯处理
let extendedList = ref([]);// ;
const getSwiperList = async () => {
extendedList.value = await swiperList();
// extendedList.value = await swiperList();
extendedList.value = ["祝贺“友晟夏季封装外壳发布会”圆满成功","祝贺“友晟科技发布会”圆满成功","祝贺“友晟夏季封装外壳发布会”圆满成功"]
}
getSwiperList();
// 日程提醒
let weekStr = ref(null) //'2025-09-19 星期三'
let stepList = ref([]);
const getStepData = async ()=>{
let res = await stepData({});
// let res = await stepData({});
let res={
date:new Date().getTime(),
list:[
{ id:1,desc: '2025秋季产品发布前期准备会在科研楼0317会议室召开。', title: '13:30 — 15:30',beginTime:'13:30',endTime:'15:30'},
{ id:2,desc: '生产间安全巡检。', title: '16:30 — 18:00',beginTime:'16:30',endTime:'18:00'},
]
}
weekStr.value = getWeekStr(res.date);
stepList.value = res.list;
}
getStepData();
// 销售任务完成情况
let salesList = ref([]);
@@ -251,21 +270,36 @@ let percentNum = ref(0);
let totalSales = ref(0)
let targetSales = ref(0)
const getSalesTask = async ()=>{
let res = await salesTask({});
// let res = await salesTask({});
let res = {
salesList:['2025-3季度', '2025-2季度', '2025-1季度'],
percentNum:82,
totalSales:62075000,
targetSales:75000000
}
salesList.value = res.salesList;
percentNum.value = res.percentNum;
totalSales.value = formatMoney(res.totalSales);
targetSales.value = formatMoney(res.targetSales);
}
getSalesTask();
// 常用服务
let commonServiceList = ref([])
const getCommonServices = async ()=>{
let res = await commonServices({});
// let res = await commonServices({});
let res = {
list:[
{id:1,name:'设备管理',imgSrc:'static/images/business/icon-sbgl.png'},
{id:2,name:'目标管理',imgSrc:'static/images/business/icon-mbgl.png'},
{id:3,name:'科研工艺',imgSrc:'static/images/business/icon-kygy.png'},
{id:4,name:'工艺攻关',imgSrc:'static/images/business/icon-gygg.png'},
{id:5,name:'数据采集',imgSrc:'static/images/business/icon-sjcj.png'}
],
}
commonServiceList.value = res.list
}
getCommonServices();
// 添加常用服务
const handleAddCommonSercice = ()=>{
@@ -274,10 +308,17 @@ const handleAddCommonSercice = ()=>{
// 新闻公告
let newsList = ref([])
const getNewsList = async()=>{
let res = await newsQueryList({});
// let res = await newsQueryList({});
let res = {
list:[
{id:1,date:'2025-06-29',name:'友晟亮相2025慕尼黑上海电子展',imgSrc:'https://img2.baidu.com/it/u=363858033,1221485415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067'},
{id:2,date:'2025-06-26',name:'孜孜不倦,谱写公司发展新篇章',imgSrc:'https://img0.baidu.com/it/u=2830423559,3962669886&fm=253&app=138&f=JPEG?w=570&h=760'},
{id:3,date:'2025-03-29 08:10:00',name:'质量管理体系提升助力实现质的飞跃',imgSrc:''},
],
}
newsList.value = res.list;
}
getNewsList();
const formatDateStr =(times)=>{
return formatTimestamp(times)
}

View File

@@ -90,7 +90,7 @@ let getOSVesion = async()=>{
versionData.value = param;
let data = await versionCheck(param);
newVersion.value = data.verNumber;
downloadURL.value = data.downloadUrl;
downloadURL.value = data.downloadUrl || '';
// isForceUpdate 是否强制更新 1-是 2-否
let isForceUpdate = data.isForceUpdate;

View File

@@ -140,7 +140,26 @@ const getNoticeList = (pageIndex, pageSize) => {
pageSize
}
let res = await noticeList(param);
// let res = await noticeList(param);
let res = {
list:[
{id:1,date:'2025-06-30',isReady:true,title:'临时调整本周工作时间的通知',imgSrc:'static/images/notice/icon-TiXing@2x.png'},
{id:2,date:'2025-06-27',isReady:false,title:'8月个税扣缴申报已完成',imgSrc:'static/images/notice/icon-RiCheng@2x.png'},
{id:3,date:'2025-09-10 17:29:00',isReady:true,title:'公司班车北五环线路调整的通知',imgSrc:'static/images/notice/icon-DaiBan@2x.png'},
{id:4,date:'2025-09-09 15:36:00',isReady:true,title:'祝贺“友晟夏季封装外壳发布会”圆满成功',imgSrc:'static/images/notice/icon-TongZhi@2x.png'},
{id:5,date:'2025-09-07 08:41:00',isReady:false,title:'研发部采购验收流程【2025】修改版',imgSrc:'static/images/notice/icon-FuWu@2x.png'},
{id:6,date:'2025-09-07 08:08:00',isReady:false,title:'加强公司安全管理 迎接全市年度检查',imgSrc:'static/images/notice/icon-TongZhi@2x.png'},
{id:7,date:'2025-09-05 13:18:00',isReady:false,title:'2025年国庆节放假安排通知',imgSrc:'static/images/notice/icon-TiXing@2x.png'},
{id:8,date:'2025-06-30',isReady:true,title:'临时调整本周工作时间的通知',imgSrc:'static/images/notice/icon-TiXing@2x.png'},
{id:9,date:'2025-06-27',isReady:false,title:'8月个税扣缴申报已完成',imgSrc:'static/images/notice/icon-RiCheng@2x.png'},
{id:10,date:'2025-09-10 17:29:00',isReady:true,title:'公司班车北五环线路调整的通知',imgSrc:'static/images/notice/icon-DaiBan@2x.png'},
// {id:11,date:'2025-09-09 15:36:00',isReady:true,title:'祝贺“友晟夏季封装外壳发布会”圆满成功',imgSrc:'static/images/notice/icon-TongZhi@2x.png'},
// {id:12,date:'2025-09-07 08:41:00',isReady:false,title:'研发部采购验收流程【2025】修改版',imgSrc:'static/images/notice/icon-FuWu@2x.png'},
// {id:13,date:'2025-09-07 08:08:00',isReady:false,title:'加强公司安全管理 迎接全市年度检查',imgSrc:'static/images/notice/icon-TongZhi@2x.png'},
// {id:14,date:'2025-09-05 13:18:00',isReady:false,title:'2025年国庆节放假安排通知',imgSrc:'static/images/notice/icon-TiXing@2x.png'},
],
totalCount:14
}
resolve({
list: res.list,
total: res.totalCount

View File

@@ -4,11 +4,11 @@
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'版本更新'" :leftFlag="true" :rightFlag="false"></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
<view class="top-height"></view>
<view class="white-bg">
<view class="version-con">
<view class="v-title">当前版本 Version {{appVersion}}</view>
<block v-if="appVersion!=newVersion">
<block v-if="isCurrent==2">
<view class="v-sub-title">最新版本 Version {{ newVersion }}</view>
<view class="v-remark">
<view class="v-r-title">本期更新</view>
@@ -42,6 +42,8 @@ onLoad(async(opt) => {
let navBarPaddingTop = ref(0);
let appVersion = ref("1.0.0");//当前版本号
let newVersion = ref('1.0.0');//最新版本号
let isCurrent = ref(undefined);
let downloadURL = ref(''); //下载地址
let remark = ref('');//更新内容
onMounted(() => {
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
@@ -62,7 +64,8 @@ let getOSVesion = async()=>{
console.log("appVersion=>",appVersion)
let data = await versionCheck(param);
newVersion.value = data.verNumber;
downloadURL.value = data.downloadUrl;
downloadURL.value = data.downloadUrl || '';
isCurrent.value = data.isCurrent;
remark.value = data.remark //|| '全新的UI界面 优化了签到/打卡功能,整体流程更加简洁清晰 搜索功能全面升级 修复了已知BUG'
}
@@ -86,7 +89,8 @@ const handleDown = ()=>{
padding: 40rpx 0 ;
margin-bottom:0;
border-radius: 8px 8px 0 0;
height:calc(100vh - 105px)
height:calc(100vh - 105px);
}
.version-con{
padding:10rpx 53rpx;

View File

@@ -21,7 +21,7 @@ const requestHooks = {
if (baseUrl) {
options.url = `${baseUrl}${options.url}`;
}
const token = getToken(); console.log("token=>",token)
const token = getToken(); //console.log("token=>",token)
if (withToken && !options.header.token) {
options.header.token = token;
}