提交 3b0ddb49 authored 作者: 刘旭's avatar 刘旭

优化图片格式

上级 1c4c3af1
...@@ -4,4 +4,4 @@ VITE_APP_PORT = 3003 ...@@ -4,4 +4,4 @@ VITE_APP_PORT = 3003
# 请求接口 # 请求接口
VITE_APP_BASE_URL = "/admin" VITE_APP_BASE_URL = "/admin"
VITE_APP_BASE_IMG = "http://192.168.0.23/wx/storage/fetch/" VITE_APP_BASE_IMG = "/wx/storage/fetch/"
\ No newline at end of file \ No newline at end of file
...@@ -4,4 +4,4 @@ VITE_APP_PORT = 3002 ...@@ -4,4 +4,4 @@ VITE_APP_PORT = 3002
# 请求接口 # 请求接口
VITE_APP_BASE_URL = "/admin" VITE_APP_BASE_URL = "/admin"
VITE_APP_BASE_IMG = "http://192.168.0.23/wx/storage/fetch/" VITE_APP_BASE_IMG = "/wx/storage/fetch/"
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,10 @@ server { ...@@ -16,6 +16,10 @@ server {
} }
location /admin { location /admin {
proxy_pass http://yongxingda:80; proxy_pass http://yongxingda;
}
location /wx {
proxy_pass http://yongxingda;
} }
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<el-upload :action="uploadPath" :show-file-list="false" :headers="headers" <el-upload :action="uploadPath" :show-file-list="false" :headers="headers"
:on-success="uploadPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif"> :on-success="uploadPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif">
<!-- <img v-if="goods.picUrl" :src="goods.picUrl" class="avatar" /> --> <!-- <img v-if="goods.picUrl" :src="goods.picUrl" class="avatar" /> -->
<img v-if="goods.picUrl" :src="'http://192.168.0.23' + goods.picUrl" class="avatar" /> <img v-if="goods.picUrl" :src="goods.picUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"> <el-icon v-else class="avatar-uploader-icon">
<Plus /> <Plus />
</el-icon> </el-icon>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<el-upload :action="uploadPath" :show-file-list="false" :headers="headers" <el-upload :action="uploadPath" :show-file-list="false" :headers="headers"
:on-success="uploadSpecPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif"> :on-success="uploadSpecPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif">
<div v-if="specForm.picUrl"> <div v-if="specForm.picUrl">
<img :src="'http://192.168.0.23' + specForm.picUrl" class="avatar" /> <img :src="specForm.picUrl" class="avatar" />
</div> </div>
<el-icon v-else class="avatar-uploader-icon"> <el-icon v-else class="avatar-uploader-icon">
<Plus /> <Plus />
...@@ -284,7 +284,6 @@ let initList = () => { ...@@ -284,7 +284,6 @@ let initList = () => {
}).then((res: any) => { }).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
partsList.value = res.data.list; partsList.value = res.data.list;
console.log(partsList.value, '....');
} }
}) })
} }
......
...@@ -53,10 +53,7 @@ ...@@ -53,10 +53,7 @@
<template #default="scope"> <template #default="scope">
<el-image v-if="scope.row.picUrl.split('http').length > 1" :src="scope.row.picUrl" <el-image v-if="scope.row.picUrl.split('http').length > 1" :src="scope.row.picUrl"
style="width: 40px; height: 40px"></el-image> style="width: 40px; height: 40px"></el-image>
<img v-else :src="'http://192.168.0.23' + scope.row.picUrl" style="width: 40px; height: 40px" /> <img v-else :src="scope.row.picUrl" style="width: 40px; height: 40px" />
<!-- <el-image :src="thumbnail(scope.row.picUrl)"
:preview-src-list="toPreview(scope.row, scope.row.picUrl)" style="width: 40px; height: 40px" /> -->
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<el-upload :action="uploadPath" :limit="1" :show-file-list="false" :headers="headers" <el-upload :action="uploadPath" :limit="1" :show-file-list="false" :headers="headers"
:on-success="uploadPicUrl" list-type="picture" class="avatar-uploader" :on-success="uploadPicUrl" list-type="picture" class="avatar-uploader"
accept=".jpg,.jpeg,.png,.gif"> accept=".jpg,.jpeg,.png,.gif">
<img v-if="goods.picUrl" :src="'http://192.168.0.23' + goods.picUrl" class="avatar" /> <img v-if="goods.picUrl" :src="goods.picUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"> <el-icon v-else class="avatar-uploader-icon">
<Plus /> <Plus />
</el-icon> </el-icon>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<el-upload :action="uploadPath" :show-file-list="false" :headers="headers" <el-upload :action="uploadPath" :show-file-list="false" :headers="headers"
:on-success="uploadSpecPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif"> :on-success="uploadSpecPicUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif">
<div v-if="specForm.picUrl"> <div v-if="specForm.picUrl">
<img :src="'http://192.168.0.23' + specForm.picUrl" class="avatar" /> <img :src="specForm.picUrl" class="avatar" />
</div> </div>
<el-icon v-else class="avatar-uploader-icon"> <el-icon v-else class="avatar-uploader-icon">
<Plus /> <Plus />
...@@ -256,9 +256,7 @@ let productForm = ref({ ...@@ -256,9 +256,7 @@ let productForm = ref({
}); });
let headers = ref({ 'Authorization': sessionStorage.getItem("token") }) let headers = ref({ 'Authorization': sessionStorage.getItem("token") })
let products = ref([ let products = ref([]);
{ id: 0, specifications: ["标准"], price: 0.0, number: 0, url: "" },
]);
let attributeVisiable = ref(false); let attributeVisiable = ref(false);
let attributeForm = ref({ attribute: "", value: "" } as any); let attributeForm = ref({ attribute: "", value: "" } as any);
...@@ -316,7 +314,7 @@ let handleCancel = () => { ...@@ -316,7 +314,7 @@ let handleCancel = () => {
keywords: undefined, keywords: undefined,
} }
specifications.value = [] specifications.value = []
products.value = [{ id: 0, specifications: ["标准"], price: 0.0, number: 0, url: "" },] products.value = []
goodsParts.value = [] goodsParts.value = []
attributes.value = [] attributes.value = []
shelvesDrawer.value = false shelvesDrawer.value = false
...@@ -401,12 +399,8 @@ let handleRemove = (file: any, fileList: any) => { ...@@ -401,12 +399,8 @@ let handleRemove = (file: any, fileList: any) => {
} }
let specChanged = (label: any) => { let specChanged = (label: any) => {
if (label === false) { if (label === false) {
specifications.value = [ specifications.value = [];
{ specification: "规格", value: "标准", picUrl: "" }, products.value = [];
];
products.value = [
{ id: 0, specifications: ["标准"], price: 0.0, number: 0, url: "" },
];
} else { } else {
specifications.value = []; specifications.value = [];
products.value = []; products.value = [];
...@@ -540,23 +534,6 @@ let specToProduct = () => { ...@@ -540,23 +534,6 @@ let specToProduct = () => {
products = products; products = products;
} }
let handleProductShow = (row: any) => {
productForm = Object.assign({}, row);
productVisiable.value = true;
}
let uploadProductUrl = (res: any) => {
productForm.value.url = res.data.url;
}
let handleProductEdit = () => {
for (let i = 0; i < products.value.length; i++) {
const v = products.value[i];
if (v.id === productForm.value.id) {
products.value.splice(i, 1, productForm.value);
break;
}
}
productVisiable.value = false;
}
let handleAttributeShow = () => { let handleAttributeShow = () => {
attributeForm.value = {}; attributeForm.value = {};
attributeVisiable.value = true; attributeVisiable.value = true;
......
...@@ -92,6 +92,10 @@ export default ({ command, mode }) => { ...@@ -92,6 +92,10 @@ export default ({ command, mode }) => {
target: "http://192.168.0.23/", target: "http://192.168.0.23/",
// rewrite: (path) => path.replace(/^\/api/, '') // rewrite: (path) => path.replace(/^\/api/, '')
}, },
"/wx": {
target: "http://192.168.0.23/",
// rewrite: (path) => path.replace(/^\/api/, '')
},
// 正则表达式写法 // 正则表达式写法
// '^/fallback/.*': { // '^/fallback/.*': {
// target: 'http://jsonplaceholder.typicode.com', // target: 'http://jsonplaceholder.typicode.com',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论