fix: BUG修改

This commit is contained in:
kun 2024-06-13 11:13:39 +08:00
parent ba7b0e85cd
commit b784bd3c86
11 changed files with 101 additions and 50 deletions

View File

@ -38,18 +38,18 @@ 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://182.90.224.237:51234/' //郭圣雄本地 // Vue.prototype.url_config = 'http://182.90.224.237:51234/' //郭圣雄本地
// 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.126:5173' // 工作流地址 // Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址
// 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' // 工作流地址
// Vue.prototype.url_config = 'http://8.142.139.165:7080/' // 湖里 // Vue.prototype.url_config = 'http://8.142.139.165:7080/' // 湖里

View File

@ -220,7 +220,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -286,6 +287,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{
@ -302,6 +306,7 @@
// //
let name = url.substring(url.lastIndexOf('/') + 1); let name = url.substring(url.lastIndexOf('/') + 1);
console.log(name, "文件名称"); console.log(name, "文件名称");
if (isVideoLink(url) || isImageLink(url)) { if (isVideoLink(url) || isImageLink(url)) {
// //
this.show = true; this.show = true;

View File

@ -176,7 +176,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components: { components: {
@ -242,6 +243,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() {}, mounted() {},
methods: { methods: {
getType(url) { getType(url) {

View File

@ -184,7 +184,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -250,6 +251,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{

View File

@ -183,7 +183,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -249,6 +250,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{

View File

@ -183,7 +183,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -249,6 +250,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{

View File

@ -282,7 +282,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components: { components: {
@ -348,6 +349,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() {}, mounted() {},
methods: { methods: {
getType(url) { getType(url) {

View File

@ -192,7 +192,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -258,6 +259,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{

View File

@ -204,7 +204,8 @@
isVideoLink, isVideoLink,
isImageLink, isImageLink,
openOutsideFile, openOutsideFile,
openLocalFile openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js' } from '@/utils/tool.js'
export default { export default {
components:{ components:{
@ -270,6 +271,9 @@
}) })
this.detailId = val.id this.detailId = val.id
}, },
onUnload() {
removeNetWorkFileTemp();
},
mounted() { mounted() {
}, },
methods:{ methods:{

File diff suppressed because one or more lines are too long

View File

@ -104,6 +104,24 @@ export function getFileImgByType(fileName) {
const type = fileTypeMap.get(fileName.split('.').pop()) const type = fileTypeMap.get(fileName.split('.').pop())
return `/static/image/filetype/${(type || '') === '' ? 'file': type}.png` return `/static/image/filetype/${(type || '') === '' ? 'file': type}.png`
} }
//记录下本地文件(网络下载),方便打开的时候直接取本地
export function saveNetWorkFileTemp(file) {
// #ifndef H5
let fileObj = uni.getStorageSync('localNetWorkFile')
if (!fileObj) {
fileObj = {}
}
fileObj[file.name] = file.path
uni.setStorageSync('localNetWorkFile', fileObj)
// #endif
}
//清除下本地文件(网络下载)
export function removeNetWorkFileTemp(name) {
// #ifndef H5
uni.setStorageSync('localNetWorkFile', {})
// #endif
}
//记录下本地文件,方便打开的时候直接取本地 //记录下本地文件,方便打开的时候直接取本地
export function saveFileTemp(file) { export function saveFileTemp(file) {
@ -128,17 +146,16 @@ export function removeFileTemp(name) {
//下载并打开文件 //下载并打开文件
export function openLocalFile(name, path) { export function openLocalFile(name, path) {
console.log(path)
//除h5外其他端先看本地有没有没有就下载到本地再打开有就直接打开 //除h5外其他端先看本地有没有没有就下载到本地再打开有就直接打开
// #ifdef H5 // #ifdef H5
window.open(path) window.open(path)
// #endif // #endif
// #ifndef H5 // #ifndef H5
let fileObj = uni.getStorageSync('localFile') let fileObj = uni.getStorageSync('localNetWorkFile')
if (fileObj && fileObj[name]) { if (fileObj && fileObj[name]) {
uni.openDocument({ uni.openDocument({
filePath: fileObj.path, filePath: fileObj[name],
showMenu: true, showMenu: true,
fileType: getFileImgByType(name), fileType: getFileImgByType(name),
success: function(res) { success: function(res) {
@ -156,37 +173,38 @@ export function openLocalFile(name, path) {
}); });
//ios中文文件名会报错需要编码下 //ios中文文件名会报错需要编码下
let filePath = uni.getSystemInfoSync().platform === 'ios' ? res.tempFilePath : escape(res let filePath = uni.getSystemInfoSync().platform === 'ios' ? res.tempFilePath : escape(res
.tempFilePath) .tempFilePath);
uni.saveFile({ uni.saveFile({
tempFilePath: filePath, //临时路径 tempFilePath: filePath, //临时路径
success: function(res) { success: function(res) {
uni.showToast({ // uni.showToast({
icon: 'none', // icon: 'none',
mask: true, // mask: true,
title: '保存在:' + res.savedFilePath, //保存路径 // title: '保存在:' + res.savedFilePath, //保存路径
duration: 2000, // duration: 2000,
}); // });
//保存好再打开文件 //保存好再打开文件
setTimeout(() => { saveNetWorkFileTemp({name: name,path: res.savedFilePath})
uni.openDocument({ // setTimeout(() => {
filePath: res.savedFilePath, // uni.openDocument({
showMenu: true, // filePath: res.savedFilePath,
fileType: getFileImgByType(name), // showMenu: true,
success: function(res) { // fileType: getFileImgByType(name),
console.log('打开文档成功'); // success: function(res) {
} // console.log('打开文档成功');
}); // }
}, 1000) // });
// }, 1000)
} }
}) })
// uni.openDocument({ uni.openDocument({
// filePath: filePath, filePath: filePath,
// showMenu: true, showMenu: true,
// fileType: getFileImgByType(name), fileType: getFileImgByType(name),
// success: function(res) { success: function(res) {
// console.log('打开文档成功'); console.log('打开文档成功');
// } }
// }); });
} }
}); });