接口调试
This commit is contained in:
parent
1dc8d975b6
commit
5749b0cc58
|
|
@ -5,7 +5,7 @@ VITE_BUILD_MODE = 'dev'
|
|||
# 开发环境接口地址
|
||||
VITE_API_URL = '/proxyApi'
|
||||
|
||||
# VITE_proxyTarget = 'http://10.40.92.16:8080'
|
||||
VITE_proxyTarget = 'http://10.40.92.186:8080'
|
||||
VITE_proxyTarget = 'http://10.40.92.7:8081'
|
||||
# VITE_proxyTarget = 'http://10.40.92.186:8080'
|
||||
# VITE_proxyTarget = 'http://10.40.92.64:8080'
|
||||
# 9502 9206
|
||||
|
|
@ -17,6 +17,8 @@
|
|||
</el-upload>
|
||||
<el-progress v-if="showProcessFlag && processFlag" :percentage="loadProcess"></el-progress>
|
||||
</div>
|
||||
<el-image id="previewDom" style="width: 100px; height: 100px" :src="previewList[0]" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2"
|
||||
:preview-src-list="previewList" :initial-index="4" fit="cover" :preview-teleporte="true" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -25,6 +27,7 @@ import { ElMessage } from 'element-plus'
|
|||
// import { Base64 } from 'js-base64'
|
||||
const tmpUploadUrl = import.meta.env.VITE_API_URL + '/zlpt-file/file/cos/upload'
|
||||
import { useStore } from 'store/main'
|
||||
const emits = defineEmits(['update:fileList'])
|
||||
const store = useStore()
|
||||
const headerInfo = reactive({
|
||||
Authorization: store.token
|
||||
|
|
@ -146,6 +149,11 @@ const officeType = ['doc', 'docx', 'xlsx', 'xls']
|
|||
let processFlag = ref(false) //是否显示进度条
|
||||
let loadProcess = ref(0) //进度条的刻度值
|
||||
|
||||
const previewList = computed(()=>{
|
||||
return props.fileList.map((ele:any)=>ele.url)
|
||||
})
|
||||
|
||||
|
||||
// 上传图片 成功
|
||||
const successUpload = (response: any, file: any) => {
|
||||
console.log('successUpload', response, file)
|
||||
|
|
@ -199,13 +207,24 @@ const handleExceed = (files: any, fileList: any) => {
|
|||
}
|
||||
// 移除文件
|
||||
const removeFile = (file: any, data: any) => {
|
||||
console.log(file, data)
|
||||
console.log("removeFile", file, data)
|
||||
// props.fileList = data
|
||||
|
||||
emits("update:fileList", data)
|
||||
|
||||
}
|
||||
// 预览
|
||||
const preview = (data: any) => {
|
||||
console.log(data, '****预览文件')
|
||||
window.open(data.response.msg)
|
||||
console.log('****预览文件', data)
|
||||
// window.open(data.response.msg)
|
||||
const suffixFileType = data.name.split('.').pop()
|
||||
console.log("suffixFileTypeType",suffixFileType)
|
||||
console.log("suffixFileTypeType",suffixFileTypeType)
|
||||
if (props.preveiwTypeList.includes(suffixFileType)) {
|
||||
//新窗口打开 预览图片文件
|
||||
window.open('/api/abk/web/v1/resource/file?fileId=' + (url || response.data), '_blank')
|
||||
}
|
||||
// previewDom
|
||||
return
|
||||
|
||||
const { url, response = {} } = data || {}
|
||||
|
|
@ -215,7 +234,7 @@ const preview = (data: any) => {
|
|||
if (!name) {
|
||||
name = ''
|
||||
}
|
||||
const suffixFileType = name.split('.').pop()
|
||||
|
||||
if (downLoadTypeList.includes(suffixFileType)) {
|
||||
//预览 'doc', 'docx', 'xlsx', 'xls', 'txt' 文件
|
||||
name = name.replace(/&/g, '') // & 不兼容
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ service.interceptors.response.use(
|
|||
return res
|
||||
},
|
||||
(error) => {
|
||||
|
||||
if(error.response.status == 500){
|
||||
ElMessage.error("服务器内部错误,请稍后重试")
|
||||
}
|
||||
console.log('error-异常', error)
|
||||
}
|
||||
)
|
||||
|
|
@ -53,10 +55,7 @@ const handleDataCode = (res: any) => {
|
|||
} else if (data.code == '401') {
|
||||
ElMessage.error(data.msg)
|
||||
router.push('/login')
|
||||
} else if (data.code == '500') {
|
||||
ElMessage.error(data.msg)
|
||||
router.push('/login')
|
||||
}
|
||||
}
|
||||
else {
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="图片:" prop="carUrl">
|
||||
<uploadCom :maxLimit="1" listType="picture-card" :acceptTypeList="['.jpg', '.jpeg', '.png']" width="120px"
|
||||
height="120px" :autoUpload="true" :successResultCallBack="successResultCallBackFn" :fileList="fileList">
|
||||
height="120px" :autoUpload="true" :successResultCallBack="successResultCallBackFn" v-model:fileList="fileList">
|
||||
<template v-slot:default>
|
||||
<el-icon size="48" color="#aaa">
|
||||
<Plus />
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<el-date-picker v-model.trim="filterForm.dataRange" type="daterange" range-separator="To" start-placeholder="Start date"
|
||||
end-placeholder="End date" />
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right;margin-top: 12px;">
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @click="serachFn">查询</el-button>
|
||||
<el-button type="plain" @click="resetFn">重置</el-button>
|
||||
<el-button type="primary" @click="exportFn">导出</el-button>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<el-date-picker v-model.trim="filterForm.dataRange" type="daterange" range-separator="To" start-placeholder="Start date"
|
||||
end-placeholder="End date" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top:12px;float:right;">
|
||||
<el-form-item style="float:right;">
|
||||
<el-button type="primary" @click="serachFn">查询</el-button>
|
||||
<el-button type="plain" @click="resetFn">重置</el-button>
|
||||
<el-button type="primary" @click="addFn">入驻</el-button>
|
||||
|
|
|
|||
|
|
@ -143,10 +143,10 @@ const exportFn = async () => {
|
|||
const res: any = await apiCompanyExportExcel({})
|
||||
// console.log("res-apiCompanyExportExcel", res)
|
||||
|
||||
const data = res.data.body
|
||||
console.log("res-apiCompanyExportExcel", data)
|
||||
// const data = res.data.body
|
||||
console.log("res-apiCompanyExportExcel", res)
|
||||
|
||||
exportBlob(data)
|
||||
exportBlob(res)
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: "导出成功"
|
||||
|
|
|
|||
Loading…
Reference in New Issue