This commit is contained in:
”Rain“ 2024-05-22 03:35:50 +08:00
parent fd3deaac0e
commit 375ca5b3eb
5 changed files with 92 additions and 36 deletions

View File

@ -37,15 +37,15 @@ if (process.env.NODE_ENV === 'development') {
console.log('开发环境') console.log('开发环境')
// Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢正式地址(弃用) // Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢正式地址(弃用)
// Vue.prototype.url_config = 'http://42.180.188.17:9809/' // 鞍钢正式地址 // Vue.prototype.url_config = 'http://42.180.188.17:9809/' // 鞍钢正式地址
Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址 // Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址
// Vue.prototype.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址 // Vue.prototype.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址
// Vue.prototype.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址 // Vue.prototype.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址
// Vue.prototype.url_config = ' http://192.168.34.221:28888/' //郭圣雄本地 // Vue.prototype.url_config = ' http://192.168.34.221:28888/' //郭圣雄本地
// Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地 Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地
// Vue.prototype.url_config = 'http://192.168.34.155:19111/' //彭洁本地 // Vue.prototype.url_config = 'http://192.168.34.155:19111/' //彭洁本地
// Vue.prototype.work_url = 'http://47.93.215.234:19997' // 工作流线上地址(弃用) // Vue.prototype.work_url = 'http://47.93.215.234:19997' // 工作流线上地址(弃用)
// Vue.prototype.work_url = 'http://42.180.188.17:19997' // 工作流线上地址 // Vue.prototype.work_url = 'http://42.180.188.17:19997' // 工作流线上地址
Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址 // Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址
// Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址 // Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址
// Vue.prototype.work_url = 'http://139.9.66.234:5173' // 工作流地址 // Vue.prototype.work_url = 'http://139.9.66.234:5173' // 工作流地址
// Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址 // Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址

View File

@ -11,7 +11,7 @@
</view> </view>
<view class="btns"> <view class="btns">
<view class="user feedback" @click="goto('user')">用户登录</view> <view class="user feedback" @click="goto('user')">用户登录</view>
<!-- <view class="feedback personLocation" @click="gotoPersonLocation()">施工人员登录</view> --> <view class="feedback personLocation" @click="gotoPersonLocation()">施工人员登录</view>
<!-- <view class="user feedback" @click="goto('user')">我是用户</view> --> <!-- <view class="user feedback" @click="goto('user')">我是用户</view> -->
<!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> --> <!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> -->
</view> </view>

View File

@ -93,14 +93,16 @@
<view class="rescue-detail data"> <view class="rescue-detail data">
<view> <view>
<text>处置资料</text> <text>处置资料</text>
<text v-if="emergencyInfo.disposalInformation" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518" <text v-if="emergencyInfo.disposalInformation"
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
@click="downloadReport(emergencyInfo.disposalInformation)"> @click="downloadReport(emergencyInfo.disposalInformation)">
{{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }} {{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }}
</text> </text>
</view> </view>
<view> <view>
<text>指导文件</text> <text>指导文件</text>
<text v-if="emergencyInfo.guidanceDocument" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518" <text v-if="emergencyInfo.guidanceDocument"
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
@click="downloadReport(emergencyInfo.guidanceDocument)"> @click="downloadReport(emergencyInfo.guidanceDocument)">
{{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }} {{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }}
</text> </text>
@ -167,7 +169,7 @@
</view> </view>
<view v-if="emergencyDetail.dispositionStatus != 3"> <view v-if="emergencyDetail.dispositionStatus != 3">
<view class="rescue-report"> <view class="rescue-report">
<uni-file-picker limit="1" @select="canversList" file-mediatype="all" title="最多选择1个文件"> <uni-file-picker v-model="imgList" limit="1" @select="canversList" file-mediatype="all" title="最多选择1个文件">
<!-- <image src="/static/icon-add.png" class="icon-add"></image> --> <!-- <image src="/static/icon-add.png" class="icon-add"></image> -->
<uni-icons2 type="plusempty" :size="19"></uni-icons2> <uni-icons2 type="plusempty" :size="19"></uni-icons2>
选择文件 选择文件
@ -230,8 +232,9 @@
}, },
methods: { methods: {
downloadReport(row) { downloadReport(row) {
const url = row && row != "null" && row[0].url; console.log(JSON.parse(row));
const fileName = row && row != "null" && row[0].name; const url = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].url;
const fileName = row != "null"&& JSON.parse(row).length > 0 && JSON.parse(row)[0].name;
if (!url) { if (!url) {
uni.showToast({ uni.showToast({
title: "暂无下载文件!", title: "暂无下载文件!",
@ -246,7 +249,7 @@
url: url, // url: url, //
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({ uni.saveFile({
filePath: res.tempFilePath, // filePath: res.tempFilePath, //
success: res => { // success: res => { //
uni.hideLoading() uni.hideLoading()
@ -255,22 +258,35 @@
}) })
} }
}) })
console.log(111111);
// uni.saveImageToPhotosAlbum({ //
// filePath: res.tempFilePath,
// success: (res) => {
// uni.hideLoading(); //
// uni.showToast({
// title: ''
// })
// }
// })
} }
} },
fail: () => {
uni.hideLoading(); //
},
}); });
// fetch(url) fetch(url)
// .then(response => response.blob()) .then(response => response.blob())
// .then(blob => { .then(blob => {
// const link = document.createElement('a'); const link = document.createElement('a');
// link.href = URL.createObjectURL(blob); link.href = URL.createObjectURL(blob);
// link.download = fileName; link.download = fileName;
// link.target = "_blank"; // link.target = "_blank"; //
// link.click(); link.click();
// }); });
}, },
addSaveBtn() { addSaveBtn() {
if (this.imgList == null||this.imgList.length == 0) { if (this.imgList == null || this.imgList.length == 0) {
uni.showToast({ uni.showToast({
title: "请提交处置报告", title: "请提交处置报告",
icon: "none" icon: "none"
@ -303,7 +319,17 @@
}, },
canversList(e) { canversList(e) {
const that = this; const that = this;
console.log(e); const accept=["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf","txt"]
const findIndex = accept.findIndex(item => item == e.tempFiles[0].extname);
// console.log(findIndex,e.tempFiles[0].extname);
if(findIndex == -1){
that.imgList = [];
uni.showToast({
title: '请上传文件类型!',
icon:"none"
})
return
}
that.imgList = that.imgList == null ? [] : that.imgList; that.imgList = that.imgList == null ? [] : that.imgList;
uni.uploadFile({ uni.uploadFile({
url: that.url_config + 'upload/image', // url: that.url_config + 'upload/image', //
@ -360,7 +386,8 @@
const find = that.emergencyTypeList.find(item => item.id == res.result const find = that.emergencyTypeList.find(item => item.id == res.result
.emergencyTypeId); .emergencyTypeId);
that.emergencyInfo = find ? find : {}; that.emergencyInfo = find ? find : {};
this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON.parse(res.result.disposalReport) : []; this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON
.parse(res.result.disposalReport) : [];
} }
}) })
}, },

View File

@ -93,14 +93,16 @@
<view class="rescue-detail data"> <view class="rescue-detail data">
<view> <view>
<text>处置资料</text> <text>处置资料</text>
<text v-if="emergencyInfo.disposalInformation" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518" <text v-if="emergencyInfo.disposalInformation"
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
@click="downloadReport(emergencyInfo.disposalInformation)"> @click="downloadReport(emergencyInfo.disposalInformation)">
{{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }} {{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }}
</text> </text>
</view> </view>
<view> <view>
<text>指导文件</text> <text>指导文件</text>
<text v-if="emergencyInfo.guidanceDocument" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518" <text v-if="emergencyInfo.guidanceDocument"
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
@click="downloadReport(emergencyInfo.guidanceDocument)"> @click="downloadReport(emergencyInfo.guidanceDocument)">
{{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }} {{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }}
</text> </text>
@ -121,7 +123,7 @@
<text>{{item.disposalPersonName}}</text> <text>{{item.disposalPersonName}}</text>
</view> </view>
<!-- style="flex-direction: column;" --> <!-- style="flex-direction: column;" -->
<view > <view>
<text>现场情况视频</text> <text>现场情况视频</text>
<view v-if="item.liveVideoSituation && JSON.parse(item.liveVideoSituation).length>0" <view v-if="item.liveVideoSituation && JSON.parse(item.liveVideoSituation).length>0"
class="imgBox flex2" v-for="(ele,index) in JSON.parse(item.liveVideoSituation)" class="imgBox flex2" v-for="(ele,index) in JSON.parse(item.liveVideoSituation)"
@ -215,8 +217,8 @@
}, },
methods: { methods: {
downloadReport(row) { downloadReport(row) {
const url = row && row != "null" && row[0].url; const url = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].url;
const fileName = row && row != "null" && row[0].name; const fileName = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].name;
if (!url) { if (!url) {
uni.showToast({ uni.showToast({
title: "暂无下载文件!", title: "暂无下载文件!",
@ -227,22 +229,47 @@
uni.showLoading({ uni.showLoading({
title: "保存中..." title: "保存中..."
}) })
console.log(url);
uni.downloadFile({ uni.downloadFile({
url: url, // url: url, //
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({ // uni.saveFile({
filePath: res.tempFilePath, // // filePath: res.tempFilePath, //
success: res => { // // success: res => { //
uni.hideLoading() // uni.hideLoading()
// uni.showToast({
// title: ""
// })
// }
// })
uni.saveImageToPhotosAlbum({ //
filePath: res.tempFilePath,
success: (res) => {
uni.hideLoading(); //
uni.showToast({ uni.showToast({
title: "保存成功!" title: '图片已保存'
}) })
} }
}) })
} }
} },
fail: () => {
uni.hideLoading(); //
},
}); });
// #ifdef H5
fetch(url)
.then(response => response.blob())
.then(blob => {
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.target = "_blank"; //
link.click();
});
// #endif
}, },
onSubmitAll() { onSubmitAll() {
this.sendRequest({ this.sendRequest({
@ -586,8 +613,10 @@
} }
} }
.imgBox_wrap,.imgBox { .imgBox_wrap,
.imgBox {
margin: 0 !important; margin: 0 !important;
view { view {
margin: 0 !important; margin: 0 !important;
} }