Commit 5cfdd1a6 by linjinhong

修改图片最大尺寸

parent a8b467a5
......@@ -404,4 +404,17 @@ export default {
res.json({ code: 500, msg: err });
}
},
//获取国家名称及代码
getAllCountry: async (req, res) => {
const token = req.headers["jwt-token"];
let url = "https://factory.jomalls.com/api/logisticsAddress/getAllCountry";
try {
let { data } = await axios.get(url, { headers: { "jwt-token": token } });
console.log(data);
res.send(data);
} catch (error) {
console.log(error);
res.json({ code: 500, msg: error });
}
},
};
......@@ -39,5 +39,7 @@ router.post("/processImage", fn.processImage);
// 保存生成后得图片返回地址
router.post("/saveToPng", fn.saveToPng);
// 保存生成后得图片返回地址
router.post("/getAllCountry", fn.getAllCountry);
export { router as default };
......@@ -12,6 +12,7 @@ const defaultSetting = {
export default new Vuex.Store({
state: {
actionList: [],
countryList: [],
imgList: [],
productDetail: {},
windowWH: { width: 0, height: 0 },
......@@ -94,6 +95,9 @@ export default new Vuex.Store({
setWindows(state, { width, height }) {
state.windowWH = { width, height };
},
setCountry(state, data) {
state.countryList = data;
},
},
getters: {
systemSetting(state) {
......
......@@ -88,7 +88,8 @@ export default {
actionList() {
return this.$store.getters.getActionList;
},
...mapState(["grid", "defaultProportion"]),
...mapState(["grid", "defaultProportion", "countryList"]),
},
mounted() {
// console.log(pkg, "pkg");
......@@ -588,6 +589,16 @@ export default {
return [];
}
},
getCountryName(code) {
if (code) {
const item = this.countryList?.find((el) => el.countryCode == code);
if (item) {
return `(${item.nameCn})`;
}
}
return "";
},
},
};
</script>
......@@ -849,7 +860,13 @@ export default {
v-if="user && user.factory"
style="font-weight: 700;margin-left: 8px;"
>
{{ user.factory.countryCode || "CN" }}
{{
user.factory.countryCode
? `${user.factory.countryCode}${getCountryName(
user.factory.countryCode
)}`
: "CN(中国)"
}}
</div>
<p v-if="user && user.factory">{{ user.factory.title }}</p>
<el-dropdown @command="dropdownCommand">
......
......@@ -48,6 +48,9 @@ export default {
this.$store.commit("setDefaultproportion", proportion);
this.$store.commit("setGrid");
});
if (!this.countryList.length) {
this.getAllCountryFn();
}
},
computed: {
gridWH() {
......@@ -135,6 +138,7 @@ export default {
"WHproportion",
"grid",
"windowWH",
"countryList",
]),
},
data() {
......@@ -244,6 +248,7 @@ export default {
changeCheckFn(value) {
console.log("check", value);
},
isView: {
handler(newValue) {
if (!newValue) {
......@@ -979,6 +984,15 @@ export default {
}
this.imgDom.style.webkitClipPath = gradient;
},
async getAllCountryFn() {
try {
let { data } = await this.$api.post("/getAllCountry");
this.$store.commit("setCountry", data);
console.log(991, this.countryList);
} catch (error) {
console.log(error);
}
},
},
mounted() {
this.imgHeight = window.screen.height + "px";
......@@ -1117,7 +1131,7 @@ export default {
>
<img
:key="i"
style="width: auto;height: 190px;max-width: 200px;"
style="width: auto;max-height: 190px;max-width: 200px;"
:src="img.productionFile"
/>
<!-- <span>{{ img.designId }}</span> -->
......
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