资料文件夹加数量、补正删除按钮

This commit is contained in:
xiaofajia 2024-12-14 15:41:46 +08:00
parent ddfd6c0e8a
commit 356b8eedfd
4 changed files with 56 additions and 21 deletions

View File

@ -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',

View File

@ -191,7 +191,7 @@
onShow() {
this.getAppointAndPickNum()
this.getindex()
this.getwarnMsglist()
// this.getwarnMsglist()
this.getbottom()
},

View File

@ -71,7 +71,6 @@
mode="date"
return-type='string'
></u-datetime-picker>
<view class="anniu" @click="getnewsadd()">
<text>保存</text>
</view>
@ -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'
})
}
}

View File

@ -37,6 +37,8 @@
<view class="">{{item.fileName}}</view>
<view class="" v-if="item.warnTime">{{item.warnTime}}</view>
<view class="" v-if="!item.warnTime" style=" visibility: hidden;">{{'1'}}</view>
<view class="" v-if="item.count">文件数:{{item.count}}</view>
<view class="" v-if="!item.count" style=" visibility: hidden;">{{'1'}}</view>
<view class="bsd-dis">
<view class="bianji" v-if="item.type == '2'" @click="viewFile(item.filePath)">预览</view>
<view class="bianji" @click="editFile(item.id)">编辑</view>
@ -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()
})
}
}
});