From 356b8eedfd0cea12b3c48607da46dddc54e629a6 Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Sat, 14 Dec 2024 15:41:46 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=96=99=E6=96=87=E4=BB=B6=E5=A4=B9?=
=?UTF-8?q?=E5=8A=A0=E6=95=B0=E9=87=8F=E3=80=81=E8=A1=A5=E6=AD=A3=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.js | 2 +-
pages/index/synthesis.vue | 2 +-
pages/manage/deviceAdd.vue | 35 +++++++++++++++++++++++---------
pages/manage/deviceManage.vue | 38 ++++++++++++++++++++++++++---------
4 files changed, 56 insertions(+), 21 deletions(-)
diff --git a/config.js b/config.js
index d7264f2..a9ff85e 100644
--- a/config.js
+++ b/config.js
@@ -2,7 +2,7 @@
module.exports = {
// baseUrl: 'https://www.nuoyunr.com/admin-api',
// baseUrl: 'http://127.0.0.1:48080/admin-api',
- baseUrl: 'http://8fh65c.natappfree.cc/admin-api',
+ baseUrl: 'http://zjcptv.natappfree.cc/admin-api',
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
baseImageUrl: 'https://www.nuoyunr.com/minio',
wsUrl: 'ws://127.0.0.1:48080',
diff --git a/pages/index/synthesis.vue b/pages/index/synthesis.vue
index c6f581f..01895d4 100644
--- a/pages/index/synthesis.vue
+++ b/pages/index/synthesis.vue
@@ -191,7 +191,7 @@
onShow() {
this.getAppointAndPickNum()
this.getindex()
- this.getwarnMsglist()
+ // this.getwarnMsglist()
this.getbottom()
},
diff --git a/pages/manage/deviceAdd.vue b/pages/manage/deviceAdd.vue
index 15b2248..952b8c4 100644
--- a/pages/manage/deviceAdd.vue
+++ b/pages/manage/deviceAdd.vue
@@ -71,7 +71,6 @@
mode="date"
return-type='string'
>
-
保存
@@ -145,8 +144,8 @@
},
fileTitle:'上传附件'
},
- result:''
-
+ result:'',
+ uploadWaiting: false,
}
},
@@ -202,7 +201,21 @@
//发布按钮
async getnewsadd(){
if(this.maneizhi =='2'){
- if(this.box.filePath==''||this.box.fileName==''||this.box.warnTime==''){
+ if (this.box.fileName==''||this.box.warnTime==''){
+ uni.showToast({
+ title:'必填项不能有空!',
+ icon:'none'
+ })
+ return
+ }
+ if (!this.uploadWaiting){
+ uni.showToast({
+ title:'请等待上传完成!',
+ icon:'none'
+ })
+ return
+ }
+ if(this.box.filePath==''){
uni.showToast({
title:'必填项不能有空!',
icon:'none'
@@ -218,6 +231,7 @@
return
}
}
+ this.uploadWaiting = false
if(this.type == 'add'){
this.box.fatherId = this.fileId
let res = await request({
@@ -230,9 +244,7 @@
title:'发布成功'
})
setTimeout(() => {
- uni.navigateBack({
- delta: 1
- });
+ uni.navigateBack();
}, 1000);
}
}
@@ -247,9 +259,7 @@
title:'发布成功'
})
setTimeout(() => {
- uni.navigateBack({
- delta: 1
- });
+ uni.navigateBack();
}, 1000);
}
@@ -289,6 +299,11 @@
uploadSuccess(result){
this.result = result
this.box.filePath = result[0].fileName
+ this.uploadWaiting = true
+ uni.showToast({
+ title:'上传完成',
+ icon:'none'
+ })
}
}
diff --git a/pages/manage/deviceManage.vue b/pages/manage/deviceManage.vue
index 32330ce..cbaa7f8 100644
--- a/pages/manage/deviceManage.vue
+++ b/pages/manage/deviceManage.vue
@@ -37,6 +37,8 @@
{{item.fileName}}
{{item.warnTime}}
{{'1'}}
+ 文件数:{{item.count}}
+ {{'1'}}
预览
编辑
@@ -106,7 +108,26 @@
}
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
+ this.getCountByDirectory()
},
+ getCountByDirectory(){
+ if (this.arrlist && this.arrlist.length > 0){
+ const ids = this.arrlist.filter(item => (item.type === '1' && !item.count)).map(item => item.id)
+ if (ids && ids.length > 0){
+ request({
+ url: '/inspectionFile/inspectionFile/getCountByIds?ids=' + ids,
+ method: 'get',
+ }).then(res => {
+ if (res && res.data){
+ const map = new Map(Object.entries(res.data))
+ this.arrlist.filter(item => (item.type === '1' && !item.count)).forEach(item => {
+ this.$set(item, 'count', map.get(item.id + ''))
+ })
+ }
+ })
+ }
+ }
+ },
async getback(){
if(!this.fileId){
uni.navigateBack()
@@ -161,15 +182,14 @@
title: '确认',
content: '是否确认删除',
success: function (res) {
- request({
- url: '/inspectionFile/inspectionFile/del/'+fileId,
- method: 'post'
- }).then(res=>{
- if(res.code == 200){
- that.getlist()
- }
- })
-
+ if (res.confirm){
+ request({
+ url: '/inspectionFile/inspectionFile/del/'+fileId,
+ method: 'post'
+ }).then(res=>{
+ that.getlist()
+ })
+ }
}
});