资料文件夹加数量、补正删除按钮
This commit is contained in:
parent
ddfd6c0e8a
commit
356b8eedfd
@ -2,7 +2,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
// baseUrl: 'https://www.nuoyunr.com/admin-api',
|
// baseUrl: 'https://www.nuoyunr.com/admin-api',
|
||||||
// baseUrl: 'http://127.0.0.1:48080/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',
|
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
|
||||||
baseImageUrl: 'https://www.nuoyunr.com/minio',
|
baseImageUrl: 'https://www.nuoyunr.com/minio',
|
||||||
wsUrl: 'ws://127.0.0.1:48080',
|
wsUrl: 'ws://127.0.0.1:48080',
|
||||||
|
@ -191,7 +191,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.getAppointAndPickNum()
|
this.getAppointAndPickNum()
|
||||||
this.getindex()
|
this.getindex()
|
||||||
this.getwarnMsglist()
|
// this.getwarnMsglist()
|
||||||
this.getbottom()
|
this.getbottom()
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
mode="date"
|
mode="date"
|
||||||
return-type='string'
|
return-type='string'
|
||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
|
|
||||||
<view class="anniu" @click="getnewsadd()">
|
<view class="anniu" @click="getnewsadd()">
|
||||||
<text>保存</text>
|
<text>保存</text>
|
||||||
</view>
|
</view>
|
||||||
@ -145,8 +144,8 @@
|
|||||||
},
|
},
|
||||||
fileTitle:'上传附件'
|
fileTitle:'上传附件'
|
||||||
},
|
},
|
||||||
result:''
|
result:'',
|
||||||
|
uploadWaiting: false,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -202,7 +201,21 @@
|
|||||||
//发布按钮
|
//发布按钮
|
||||||
async getnewsadd(){
|
async getnewsadd(){
|
||||||
if(this.maneizhi =='2'){
|
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({
|
uni.showToast({
|
||||||
title:'必填项不能有空!',
|
title:'必填项不能有空!',
|
||||||
icon:'none'
|
icon:'none'
|
||||||
@ -218,6 +231,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.uploadWaiting = false
|
||||||
if(this.type == 'add'){
|
if(this.type == 'add'){
|
||||||
this.box.fatherId = this.fileId
|
this.box.fatherId = this.fileId
|
||||||
let res = await request({
|
let res = await request({
|
||||||
@ -230,9 +244,7 @@
|
|||||||
title:'发布成功'
|
title:'发布成功'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack({
|
uni.navigateBack();
|
||||||
delta: 1
|
|
||||||
});
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -247,9 +259,7 @@
|
|||||||
title:'发布成功'
|
title:'发布成功'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack({
|
uni.navigateBack();
|
||||||
delta: 1
|
|
||||||
});
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -289,6 +299,11 @@
|
|||||||
uploadSuccess(result){
|
uploadSuccess(result){
|
||||||
this.result = result
|
this.result = result
|
||||||
this.box.filePath = result[0].fileName
|
this.box.filePath = result[0].fileName
|
||||||
|
this.uploadWaiting = true
|
||||||
|
uni.showToast({
|
||||||
|
title:'上传完成',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
<view class="">{{item.fileName}}</view>
|
<view class="">{{item.fileName}}</view>
|
||||||
<view class="" v-if="item.warnTime">{{item.warnTime}}</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.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="bsd-dis">
|
||||||
<view class="bianji" v-if="item.type == '2'" @click="viewFile(item.filePath)">预览</view>
|
<view class="bianji" v-if="item.type == '2'" @click="viewFile(item.filePath)">预览</view>
|
||||||
<view class="bianji" @click="editFile(item.id)">编辑</view>
|
<view class="bianji" @click="editFile(item.id)">编辑</view>
|
||||||
@ -106,6 +108,25 @@
|
|||||||
}
|
}
|
||||||
let total = res.total
|
let total = res.total
|
||||||
this.totalPages = Math.ceil(total / this.pageSize);
|
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(){
|
async getback(){
|
||||||
if(!this.fileId){
|
if(!this.fileId){
|
||||||
@ -161,15 +182,14 @@
|
|||||||
title: '确认',
|
title: '确认',
|
||||||
content: '是否确认删除',
|
content: '是否确认删除',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
if (res.confirm){
|
||||||
request({
|
request({
|
||||||
url: '/inspectionFile/inspectionFile/del/'+fileId,
|
url: '/inspectionFile/inspectionFile/del/'+fileId,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
if(res.code == 200){
|
|
||||||
that.getlist()
|
that.getlist()
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user