Commit 5cfdd1a6 by linjinhong

修改图片最大尺寸

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