1
This commit is contained in:
parent
fd3deaac0e
commit
375ca5b3eb
6
main.js
6
main.js
@ -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' // 工作流地址
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -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,19 +258,32 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
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) {
|
||||||
@ -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) : [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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>
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user