Commit 8546bd23 authored by “yiyousong”'s avatar “yiyousong”

pref:修改图片显示

parent a5562f8d
#开发环境
NODE_ENV = "development"
#VUE_APP_API_BASE_URL=http://192.168.0.98:11078
VUE_APP_API_BASE_URL=http://10.12.185.213:11071
\ No newline at end of file
VUE_APP_API_BASE_URL=http://192.168.0.98:11078
VUE_APP_API_IMG_URL=http://192.168.0.98:11078/
#VUE_APP_API_BASE_URL=http://10.12.185.213:11071
\ No newline at end of file
......@@ -3,3 +3,4 @@ NODE_ENV = production
VUE_APP_API_BASE_URL=/basics_api
VUE_APP_API_portal_URL=/portal_home
VUE_APP_API_IMG_URL = /
......@@ -9,6 +9,7 @@ yarn-error.log*
/test/e2e/reports/
selenium-debug.log
dist.zip
基础设置系统.zip
# Editor directories and files
.idea
.vscode
......
......@@ -15,7 +15,7 @@ export default {
data() {
return {
previewInfo: this.$route.query,
previewUrl: "http://192.168.0.192:8082",
previewUrl: "",
loading: true,
};
},
......
......@@ -66,8 +66,8 @@
<img
v-if="text.img"
width="50"
:src="api + text.img"
@click="handlePreview('img', api + text.img)"
:src="api2 + text.img"
@click="handlePreview('img', api2 + text.img)"
/>
<span v-else>--</span>
</template>
......@@ -76,8 +76,8 @@
<video
v-if="text.video"
width="50"
:src="api + text.video"
@click="handlePreview('vidoe', api + text.video)"
:src="api2 + text.video"
@click="handlePreview('vidoe', api2 + text.video)"
/>
<span v-else>--</span>
</template>
......@@ -128,6 +128,7 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
appId: this.$route.query.id,
loading: false,
current: 1,
......
......@@ -49,7 +49,7 @@
v-if="text.appIconPath"
height="20"
width="20"
:src="api + text.appIconPath"
:src="api2 + text.appIconPath"
/>
<span v-else>--</span>
</template>
......@@ -172,6 +172,7 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
columns,
siteId: local.getLocal("siteId"),
tableData: [], // 表格数据
......
......@@ -41,7 +41,7 @@
<img
class="icon"
v-if="form.appIconPath"
:src="api + form.appIconPath"
:src="api2 + form.appIconPath"
/>
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
......@@ -173,6 +173,7 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
labelCol: {
span: 3,
},
......@@ -273,7 +274,7 @@ export default {
}
});
},
// 图标删除之前
// 图标上传之前
iconBeforeUpload(file) {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
......@@ -293,7 +294,6 @@ export default {
return;
}
if (info.file.status === "done") {
console.log(info);
this.form.appIconPath = info.file.response.url;
this.loading = false;
}
......
......@@ -54,11 +54,11 @@
<!-- 模块图标 -->
<template slot="modelIcon" slot-scope="text">
<div v-if="text.modelIcon">
<div class="svg-box" v-if="isSvg(text.modelIcon)">
<img width="30" height="30" :src="api + text.modelIcon" />
</div>
<div class="svg-box" v-else>
<img width="30" height="30" :src="api + text.modelIcon" />
<!-- <div class="svg-box" v-if="isSvg(text.modelIcon)">
<img width="30" height="30" :src="api2 + text.modelIcon" />
</div> -->
<div class="svg-box">
<img width="30" height="30" :src="api2 + text.modelIcon" />
</div>
</div>
<span v-else>--</span>
......@@ -161,9 +161,7 @@
>
<div v-if="fileList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">
点击上传
</div>
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload>
......@@ -275,6 +273,7 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png,image/svg+xml", // 上传类型
previewData: {}, // 预览
previewVisible: false,
......@@ -370,7 +369,7 @@ export default {
uid: -1,
status: "done",
name: this.formData.modelIcon,
url: this.api + this.formData.modelIcon,
url: this.api2 + this.formData.modelIcon,
url2: this.formData.modelIcon,
},
];
......@@ -438,7 +437,7 @@ export default {
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api + v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
......@@ -477,15 +476,15 @@ export default {
this.handleReset();
},
// 图片类型
isSvg(url) {
let index = url.lastIndexOf(".");
let str = url.slice(index + 1);
if (str === "svg") {
return true;
} else {
return false;
}
},
// isSvg(url) {
// let index = url.lastIndexOf(".");
// let str = url.slice(index + 1);
// if (str === "svg") {
// return true;
// } else {
// return false;
// }
// },
},
};
</script>
......
......@@ -331,6 +331,7 @@ export default {
};
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
loading: false,
previewData: {}, // 预览logo信息
......@@ -615,7 +616,7 @@ export default {
uid: -1,
status: "done",
name: this.formInfo.logoPath,
url: this.api + this.formInfo.logoPath,
url: this.api2 + this.formInfo.logoPath,
url2: this.formInfo.logoPath,
},
];
......@@ -665,7 +666,7 @@ export default {
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api + v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
......@@ -714,10 +715,8 @@ export default {
})
.then((res) => {
let { location } = res.geocodes[0];
[
this.formInfo.longitude,
this.formInfo.latitude,
] = location.split(",");
[this.formInfo.longitude, this.formInfo.latitude] =
location.split(",");
})
.catch(() => {
this.$message.error("经纬度获取失败,请输入正确的地址");
......
......@@ -132,7 +132,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -158,7 +158,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -192,7 +192,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -121,7 +121,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -174,7 +174,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -147,7 +147,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -91,7 +91,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -186,7 +186,7 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
......
......@@ -206,9 +206,7 @@
>
<div v-if="fileList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">
添加照片
</div>
<div class="ant-upload-text">添加照片</div>
</div>
</a-upload>
<!-- <a-upload
......@@ -389,6 +387,7 @@ export default {
};
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
......@@ -521,7 +520,7 @@ export default {
uid: -1,
status: "done",
name: this.form.photoPath,
url: this.api + this.form.photoPath,
url: this.api2 + this.form.photoPath,
url2: this.form.photoPath,
},
];
......@@ -544,7 +543,7 @@ export default {
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api + v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
......
......@@ -212,9 +212,7 @@
>
<div v-if="fileList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">
添加照片
</div>
<div class="ant-upload-text">添加照片</div>
</div>
<!-- <img
v-if="form.photoPath"
......@@ -429,6 +427,7 @@ export default {
};
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
......@@ -575,7 +574,7 @@ export default {
uid: -1,
status: "done",
name: this.form.photoPath,
url: this.api + this.form.photoPath,
url: this.api2 + this.form.photoPath,
url2: this.form.photoPath,
},
];
......@@ -594,7 +593,7 @@ export default {
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api + v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
......
......@@ -213,7 +213,7 @@
<template slot="pic" slot-scope="text">
<img
v-if="text.photoPath"
:src="api + text.photoPath"
:src="api2 + text.photoPath"
class="pht"
/>
<span v-else>--</span>
......@@ -386,6 +386,7 @@ export default {
visibleEditPwd: false,
editVisible: false,
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
siteId: local.getLocal("siteId"),
deptData: [], // 部门数据
windowData: [], // 窗口数据
......
......@@ -15,8 +15,8 @@ if (!isDev) {
events: {
onEnd: {
mkdir: ["./dist"],
delete: ["./dist.zip"],
archive: [{ source: "./dist", destination: "./dist.zip" }],
delete: ["./基础设置系统.zip"],
archive: [{ source: "./dist", destination: "./基础设置系统.zip" }],
},
},
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment